首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Cython安装错误

Cython安装错误
EN

Stack Overflow用户
提问于 2013-10-01 18:27:31
回答 2查看 6.3K关注 0票数 3

运行easy_install Cython时出错:

代码语言:javascript
复制
C:\Users\Hp>cd C:\Python27\Scripts

C:\Python27\Scripts>easy_install Cython
Searching for Cython
Reading http://pypi.python.org/simple/Cython/
Best match: Cython 0.19.1
Downloading https://pypi.python.org/packages/source/C/Cython/Cython-0.19.1.zip
d5=991e7887140b3e962ef65e9c05a8694d
Processing Cython-0.19.1.zip
Running Cython-0.19.1\setup.py -q bdist_egg --dist-dir c:\users\hp\appdata\loc
\temp\easy_install-jfquni\Cython-0.19.1\egg-dist-tmp-yxdubl
Compiling module Cython.Plex.Scanners ...
Compiling module Cython.Plex.Actions ...
Compiling module Cython.Compiler.Lexicon ...
Compiling module Cython.Compiler.Scanning ...
Compiling module Cython.Compiler.Parsing ...
Compiling module Cython.Compiler.Visitor ...
Compiling module Cython.Compiler.FlowControl ...
Compiling module Cython.Compiler.Code ...
Compiling module Cython.Runtime.refnanny ...
warning: no files found matching '*.pyx' under directory 'Cython\Debugger\Test

warning: no files found matching '*.pxd' under directory 'Cython\Debugger\Test

warning: no files found matching '*.h' under directory 'Cython\Debugger\Tests'
warning: no files found matching '*.pxd' under directory 'Cython\Utility'
error: Setup script exited with error: Unable to find vcvarsall.bat

我得到这个错误,显然一些dev文件是必需的,我不确定如何获得它的windows?

EN

回答 2

Stack Overflow用户

发布于 2015-03-18 06:15:30

我在vcvarsall.bat上也遇到了同样的问题,我在Windows8和Python3.4上解决这个问题的步骤是:

关于Cython的安装,有两种选择:从第一步开始,或者直接跳到第二步:

第一步

不使用pip安装Cython:

我从这里下载了我的版本的.whl:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#cython

然后我安装了.whl,执行以下操作:

代码语言:javascript
复制
pip install filename.whl

这样,cython就不会抱怨vcvarshall.bat了。

现在您已经安装了Cython,多亏了这一点,您将能够创建c代码,但是它会给.pyd的创建带来问题,并且一旦您开始编译代码,它将显示与缺少vcvarshall.bat之前相同的错误。这就是为什么第二步需要它的原因。

第二步

  1. Install MinGW
  2. 转到C:\Python34\Lib\distutils\

创建文件distutils.cfg并写入:

C:\MinGW\bin

  • Now编译器=mingw32

  • 添加到您的路径中您可以重新安装.whl或直接从以下位置安装Cython : pip install cython

当你尝试调用cython时,它可能仍然会给你一个错误:

代码语言:javascript
复制
   zlib1.dll was not found

  1. 只需从此处下载:

http://sourceforge.net/projects/libpng/files/zlib/1.2.3/zlib123-dll.zip/download?use_mirror=iweb&download=

  • Extract文件夹并将zlib1.dll复制粘贴到C:\MinGW\bin

现在Cython应该可以正常工作了。

此外,我在一些帖子中看到一些建议,说解决方案是安装MVS 2008,但它被弃用,所以我不推荐这个选项。

这个解决方案是我找到的多个答案的组合,我一直在尝试,直到我得到正确的解决方案,我附上了链接,以防你想看看其他解决方案或观点:

https://stackoverflow.com/a/16980330/1715716

How can I install cython

Cannot find vcvarsall.bat when running a Python script

票数 2
EN

Stack Overflow用户

发布于 2016-11-04 23:13:13

我的病毒检查工具刚刚将refnanny.pyd标记为病毒并将其清除。显然,它触发了某种启发式匹配。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19113861

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档