简体   繁体   English

scikits.sparse 安装(或构建)在 windows 和 anaconda (spyder) 上失败

[英]scikits.sparse installation(or build) fails on windows and anaconda (spyder)

I have been trying to install scikits.sparse module in python.我一直在尝试在 python 中安装scikits.sparse模块。 I feel that the module I obtained needs compilation.感觉自己得到的模块需要编译。 I guessed the same as it doesn't contain .py files, instead there is a cholmod.c and a cholmod.pyx file in the sparse directory.我猜是一样的,因为它不包含.py文件,而是在 sparse 目录中有一个cholmod.c和一个cholmod.pyx文件。 I attempted to do this in 2 ways,我试图以两种方式做到这一点,

One from Spyder , by first adding the module path to PYTHONPATH manager and then including the following lines in the program一个来自Spyder ,首先将模块路径添加到PYTHONPATH管理器,然后在程序中包含以下几行

import pyximport

pyximport.install()

from scikits.sparse.cholmod import cholesky

This gave me the error这给了我错误

ImportError: Building module scikits.sparse.cholmod failed: ["distutils.errors.CompileError: command 'C:\\\\Program Files (x86)\\\\Microsoft Visual Studio 14.0\\\\VC\\\\BIN\\\\x86_amd64\\\\cl.exe' failed with exit status 2\\n"]导入错误:构建模块 scikits.sparse.cholmod 失败:["distutils.errors.CompileError: command 'C:\\\\Program Files (x86)\\\\Microsoft Visual Studio 14.0\\\\VC\\\\BIN\\\\x86_amd64\\\\cl.exe ' 失败,退出状态为 2\\n"]

Second directly in Python 3.6 ,其次直接在Python 3.6

I installed Microsoft Visual C++ build tools 14.0 (from Visual Studio 2015), which looked like completed installation, but the final status said, It may not have installed properly.我安装了Microsoft Visual C++ build tools 14.0 (来自 Visual Studio 2015),看起来安装完成,但最终状态显示,它可能没有正确安装。

Then I updated pip , installed cython , scipy and some other dependency of scikits.sparse then on attempting installation like th following,然后,我更新的pip ,安装cythonscipy和其他一些依赖scikits.sparse然后试图像日安装之后,

python e:\python\scikits.sparse-0.2\setup.py install 

from command prompt returned an error,从命令提示符返回错误,

Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2 Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' 失败,退出状态为 2

Is there anyway to compile and build scikits.sparse in windows?无论如何要在 Windows 中编译和构建scikits.sparse吗?

Alternatively, is it possible to compile it in a Linux system to a .whl and then install it easily in windows?或者,是否可以在Linux系统.whl其编译为.whl ,然后在 Windows 中轻松安装?

Thanks in advance.提前致谢。

You just need to install C++ build tool.您只需要安装 C++ 构建工具。 In my case it was the same as per yours ie "Microsoft Visual Studio 14.0" So I installed C++ build tool from the link given below.[landinghub.visualstudio.com/visual-cpp-build-tools][1]在我的情况下,它与您的相同,即“Microsoft Visual Studio 14.0”所以我从下面给出的链接安装了 C++ 构建工具。[landinghub.visualstudio.com/visual-cpp-build-tools][1]

This showed me 2015 version, and that solved my issue.这向我展示了 2015 版本,这解决了我的问题。

Hope it's gonna work same for you too.希望它对你也一样。 If not, leave the comment below.如果没有,请在下面留下评论。

Good Luck !祝你好运 !

scikits-sparse 不是为 windows 构建的,只为 linux 构建

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM