2013-10-01 74 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爲病毒並炸燬它拿走。顯然它觸發了某種啓發式匹配。