我在Windows8.1中安装了SimpleCV 1.3 powerpack。然后我设置了所需的路径。然后我通过cmd安装了pyreadline,PIL,pip,ipython。但是当我尝试运行easy_install cython时,我得到了以下错误,
C:\Users\Ankit>easy_install Cython
Searching for Cython
Reading http://pypi.python.org/simple/Cython/
Best match: Cython 0.22
Downloading https://pypi.python.org/packages/source/C/Cython/Cython-0.22.tar.gz#
md5=1ae25add4ef7b63ee9b4af697300d6b6
Processing Cython-0.22.tar.gz
Running Cython-0.22\setup.py -q bdist_egg --dist-dir c:\users\ankit\appdata\local
\temp\easy_install-lvjvzj\Cython-0.22\egg-dist-tmp-aeuxtq
Unable to find pgen, not compiling formal grammar.
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.Tempita._tempita ...
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 '*.pxd' under directory 'Cython\Utility'
Scanners.c
C:\Python27\include\pyconfig.h(227) : fatal error C1083: Cannot open include file: 'basetsd.h': No such fil
e or directory
error: Setup script exited with error: command '"C:\Program Files (x86)\Microsof
t Visual Studio 9.0\VC\BIN\cl.exe"' failed with exit status 2请帮帮我。
发布于 2015-09-01 02:32:09
我使用的是双分区系统Windows8/Xubuntu14.04LTS。我在尝试install Cython onto Xubuntu via pip时也遇到了同样的问题。
所以我用下面的命令安装了Cython,一切都很顺利。
bashsh $ sudo apt-get install cython
这不是最好的修复方法。但是,如果你真的想把一个几乎完成的项目移植到Windows8上,可能值得一试。
编译Python main (没有main):
bash $ cython --embed -o prog.c prog.py
您可以决定使用install Mxe (MingW) gcc on linux并进行交叉编译,或者像我一样,直接在windows8中编译:
bash $ gcc -Os -IC:\Python27\include -LC:\Python27\libs -o prog.exe prog.c -lpython27 -DMS_WIN64
希望这能对你有所帮助。
https://stackoverflow.com/questions/29433941
复制相似问题