在Windows下,似乎easy_install
具有 C 依赖关系并不是很容易。
尝试 1 -vcvarsall.bat
errors
我正在安装cython
在Windows7下,与MinGw
;我修改了Windows7的PATH
包括C:\MinGw\bin
。此时,我尝试easy_install -U cython
,并得到...
C:\Users\mike_pennington\Desktop\TestDrive>easy_install -U cython
Searching for cython
Reading http://pypi.python.org/simple/cython/
Reading http://www.cython.org
Reading http://cython.org
Best match: Cython 0.15.1
Downloading http://cython.org/release/Cython-0.15.1.zip
Processing Cython-0.15.1.zip
Running Cython-0.15.1\setup.py -q bdist_egg --dist-dir c:\users\mike_p~1\appdata
\local\temp\easy_install-qr1tet\Cython-0.15.1\egg-dist-tmp-556kzq
Compiling module Cython.Plex.Scanners ...
Compiling module Cython.Compiler.Scanning ...
Compiling module Cython.Compiler.Parsing ...
Compiling module Cython.Compiler.Visitor ...
Compiling module Cython.Compiler.Code ...
Compiling module Cython.Runtime.refnanny ...
warning: no files found matching 'bugs.txt' under directory 'tests'
error: Setup script exited with error: Unable to find vcvarsall.bat
C:\Users\mike_pennington\Desktop\TestDrive>
尝试 2 - 修复vcvarsall.bat
errors
接下来,根据我发现的博客的建议,我也尝试将其放入C:\Python27\Lib\distutils\distutils.cfg
修复vcvarsall.bat
error.
[build]
compiler=mingw32
这只能起到一点帮助......
C:\Python27\Lib\DISTUT~1>easy_install -U cython
Searching for cython
Reading http://pypi.python.org/simple/cython/
Reading http://www.cython.org
Reading http://cython.org
Best match: Cython 0.15.1
Downloading http://cython.org/release/Cython-0.15.1.zip
Processing Cython-0.15.1.zip
Running Cython-0.15.1\setup.py -q bdist_egg --dist-dir c:\users\mike_p~1\appdata
\local\temp\easy_install-kfif_o\Cython-0.15.1\egg-dist-tmp-o1tbkp
Compiling module Cython.Plex.Scanners ...
Compiling module Cython.Compiler.Scanning ...
Compiling module Cython.Compiler.Parsing ...
Compiling module Cython.Compiler.Visitor ...
Compiling module Cython.Compiler.Code ...
Compiling module Cython.Runtime.refnanny ...
warning: no files found matching 'bugs.txt' under directory 'tests'
cc1.exe: error: unrecognized command line option '-mno-cygwin'
error: Setup script exited with error: command 'gcc' failed with exit status 1
C:\Python27\Lib\DISTUT~1>
警告 - 没有 cygwin 或预编译的二进制文件
我意识到我也许可以让这个工作在cygwin
;但是,我不想cygwin
对该库的依赖;我需要本机 Windows7 输出。
如果可以的话,我想避免预编译 Cython 二进制文件 http://www.lfd.uci.edu/~gohlke/pythonlibs/#cython因为正如作者所说,它们“不受支持且仅用于测试目的”。
Question
我怎样才能得到cython
通过安装easy_install
在 Windows7 下MinGw
?
经过更多的谷歌搜索后,我找到了建议删除的指南-mno-cygwin
from C:\Python27\Lib\distutils\cygwinccompiler.py
因为一个distutils错误 http://bugs.python.org/issue12641.
去除-mno-cygwin
from C:\Python27\Lib\distutils\cygwinccompiler.py
got cython
编译。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)