'easy_install -U cython'无法抱怨vcvarsall.bat和-mno-cygwin

Mik*_*ton 11 python windows mingw cython easy-install

在Windows下,似乎easy_install有一个C依赖并不是很容易.

尝试1 - vcvarsall.bat错误

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>
Run Code Online (Sandbox Code Playgroud)

尝试2 - 修复vcvarsall.bat错误

接下来,按照我发现的博客的建议,我也尝试将其C:\Python27\Lib\distutils\distutils.cfg用于修复vcvarsall.bat错误.

[build]
compiler=mingw32
Run Code Online (Sandbox Code Playgroud)

这只是略有帮助......

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>
Run Code Online (Sandbox Code Playgroud)

警告 - 没有cygwin或预编译的二进制文件

我意识到我可以让这个工作cygwin; 但是,我不想要 cygwin依赖这个库; 我需要原生的Windows7输出.

如果可能的话,我想避免预编译的Cython二进制文件,因为正如作者所说,它们"不受支持且仅用于测试目的".

如何在Windows7下cython安装?easy_installMinGw

Mik*_*ton 15

多一些google搜索后,我发现,建议取消指导,-mno-cygwinC:\Python27\Lib\distutils\cygwinccompiler.py因的distutils的错误.

删除-mno-cygwinC:\Python27\Lib\distutils\cygwinccompiler.pyGOT cython进行编译.