windows 'easy_install -U cython' 无法抱怨 vcvarsall.bat 和 -mno-cygwin
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8531983/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
'easy_install -U cython' fails complaining about vcvarsall.bat and -mno-cygwin
提问by Mike Pennington
Under Windows, it seems that easy_install
with a C dependency isn't very easy.
在 Windows 下,easy_install
C 依赖似乎不是很容易。
Attempt 1 - vcvarsall.bat
errors
尝试 1 -vcvarsall.bat
错误
I am installing cython
under Windows7, with MinGw
; I modified Windows7's PATH
to include C:\MinGw\bin
. At this point, I tried to easy_install -U cython
, and got...
我cython
在 Windows7 下安装,使用MinGw
; 我修改了 Windows7PATH
以包含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>
Attempt 2 - Fix vcvarsall.bat
errors
尝试 2 - 修复vcvarsall.bat
错误
Next, following the advice of a blog I found, I also tried putting this in C:\Python27\Lib\distutils\distutils.cfg
to fix the vcvarsall.bat
error.
接下来,按照我找到的博客的建议,我也尝试将其放入C:\Python27\Lib\distutils\distutils.cfg
以修复vcvarsall.bat
错误。
[build]
compiler=mingw32
This only helps marginally...
这只能帮助微乎其微...
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>
Caveat - No cygwin or precompiled binaries
警告 - 没有 cygwin 或预编译的二进制文件
I realize that I might be able to get this working under cygwin
; however, I don't want cygwin
dependencies on this library; I need native Windows7 output.
我意识到我也许可以让它在下面工作cygwin
;但是,我不想 cygwin
依赖这个库;我需要本机 Windows7 输出。
If possible, I would like to avoid precompiled Cython binariesbecause as the author says, they are "unsupported and for testing purposes only".
如果可能,我想避免预编译的 Cython 二进制文件,因为正如作者所说,它们“不受支持且仅用于测试目的”。
Question
题
How can I get cython
to install via easy_install
under Windows7 with MinGw
?
如何在 Windows7 下cython
通过 安装?easy_install
MinGw
回答by Mike Pennington
After more some googling, I found guidance that recommended removing -mno-cygwin
from C:\Python27\Lib\distutils\cygwinccompiler.py
because of a distutils bug.
多一些google搜索后,我发现,建议取消指导,-mno-cygwin
从C:\Python27\Lib\distutils\cygwinccompiler.py
因的distutils的错误。
Removing -mno-cygwin
from C:\Python27\Lib\distutils\cygwinccompiler.py
got cython
to compile.
-mno-cygwin
从C:\Python27\Lib\distutils\cygwinccompiler.py
必须cython
编译中删除。