Error during the installation of Cython

故事扮演 提交于 2019-12-12 04:39:43

问题


I have installed SimpleCV 1.3 powerpack in my Windows 8.1. Then i set up the required path. And then i installed pyreadline, PIL, pip, ipython via cmd. But when i tried to run easy_install cython, i'm getting the following error,

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

Please help me out.


回答1:


I'm using a double partition system Windows8/Xubuntu14.04LTS. I had the same issue when attempting to install Cython onto Xubuntu via pip.

So I installed Cython with below command and and everything went ok.

bashsh $ sudo apt-get install cython

This is not the best fix. But, may worth a trial if you are really looking to port an almost complete project to Windows8.

You compile your Python main (without main):

bash $ cython --embed -o prog.c prog.py

You may decide to install Mxe (MingW) gcc on linux and do cross compiling or, as me, to compile directly in the windows8:

bash $ gcc -Os -IC:\Python27\include -LC:\Python27\libs -o prog.exe prog.c -lpython27 -DMS_WIN64

Hope this might be of any help.



来源:https://stackoverflow.com/questions/29433941/error-during-the-installation-of-cython

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!