'easy_install -U cython'无法抱怨vcvarsall.bat和-mno-cygwin [英] 'easy_install -U cython' fails complaining about vcvarsall.bat and -mno-cygwin

查看:114
本文介绍了'easy_install -U cython'无法抱怨vcvarsall.bat和-mno-cygwin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows下,似乎具有C依赖项的easy_install并不是很容易.

Under Windows, it seems that easy_install with a C dependency isn't very easy.

我正在Windows7下用MinGw安装cython;我修改了Windows7的PATH以包含C:\MinGw\bin.在这一点上,我尝试easy_install -U cython,并得到...

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...

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错误

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

Attempt 2 - Fix vcvarsall.bat errors

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.

[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>

注意-没有Cygwin或预编译的二进制文件

我意识到我可以在cygwin下运行它;但是,我不希望该库具有cygwin依赖关系;我需要本机Windows7输出.

Caveat - No cygwin or precompiled binaries

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.

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

If possible, I would like to avoid precompiled Cython binaries because as the author says, they are "unsupported and for testing purposes only".

如何在MinGw的Windows7下通过easy_install安装cython?

How can I get cython to install via easy_install under Windows7 with MinGw?

推荐答案

经过更多的谷歌搜索后,我发现了一些指南,该指南建议从C:\Python27\Lib\distutils\cygwinccompiler.py中删除-mno-cygwin,这是因为

After more some googling, I found guidance that recommended removing -mno-cygwin from C:\Python27\Lib\distutils\cygwinccompiler.py because of a distutils bug.

C:\Python27\Lib\distutils\cygwinccompiler.py删除-mno-cygwin可以编译cython.

这篇关于'easy_install -U cython'无法抱怨vcvarsall.bat和-mno-cygwin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆