2013-10-01 77 views
3

错误时的easy_install用Cython:用Cython安装错误

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文件林不知道如何得到它的窗口?

+1

你是否安装了编译器? –

+1

'无法找到vcvarsall.bat'清楚地表明您的系统正在查找VisualC的编译器。我建议安装MinGW并按照此处所述进行操作:http://stackoverflow.com/a/16980330/1715716 –

回答

2

我是有vcvarsall.bat同样的问题,我的步骤来解决这个问题,为Windows 8和Python 3.4是:

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

第一步

而不使用PIP安装用Cython:

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

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

,然后我安装了.whl做:

pip install filename.whl 

这种方式,用Cython不会投诉约vcvarshall.bat

现在您将安装Cython,由于此,您将能够创建c代码,但它会给.pyd的创建带来问题,只要开始编译代码,它就会显示相同的错误作为befor e vcvarshall.bat缺失。这就是为什么需要第二步。

第二步

  1. 安装MinGW的

  2. 转到C:\ Python34 \ LIB \的distutils \

    创建文件distutils.cfg写:

    [build] 
    compiler = mingw32 
    
  3. 添加到您的路径C:\ MinGW的\ BIN

  4. 现在,您可以重新安装.whl或直接从安装用Cython: PIP安装用Cython

它仍然可以给你一个错误,每当你尝试打电话用Cython:

zlib1.dll was not found 
  • 刚刚从这里下载:

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

  • 提取文件夹并复制粘贴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

    0

    我的病毒检查只标示refnanny.pyd为病毒并炸毁它拿走。显然它触发了某种启发式匹配。