简体   繁体   中英

Cannot install Cython with Python 3.2 and MinGW32 under cygwin or under dos comandprompt

I am trying to install Cython 0.14 on my Windows 7, 32 bit, coupled with Python 3.2. I followed the instructions given at http://wiki.cython.org/InstallingOnWindows , but have run into several deadends. I think the I have followed the instruction for MinGW exactly, except for the part about opening prompt and test if I have installed MinGW correctly (How do I test that?).

I first ran into some errors when I tried installing Cython by typing

python setup.py install

in cygwin, but I resolved those. However, my python 3.2 still didn't know of the existence of Cython, so I tracked to problem down to cython being installed under c:\cygwin\lib\ while python is installed under c:\python32. So I tried various methods of moving cython to python folder, but since I didn't know where exactly everything goes, those attempts did not come to fruition.

In the interim, I tried to look for different, faster interpreters of python, and installed pypy. I also reinstalled python 3.2 to clear out the mess I made by trying to install cython in the python directory.

Then later I tried to install cython again using the command prompt, with the same script, but found that the default version of python has changed to 2.6, which probably sneaked in with the failed cython installations. But finding that python 2.6 can't compile the setup.py file, I just did

c:\python32\python setup.py install

in the cython directory. This worked until it gave me an error

TypeError: NoneType() is Unordered: if self.gcc_version <= "2.91.57":

in the distutils.cygwinccompiler module in python32. So I changed that to

if (not self.gcc_version == None) and self.gcc_version <= "2.91.57":

When I tried installing again under the command prompt, I get this error:

running build
running build_py
running build_ext
Access is denied.
skipping 'C:\cython-0.14.1\Cython\Plex\Scanners.c' Cython extension (up-to-date)

building 'Cython.Plex.Scanners' extension
C:\cygwin\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python32\include -IC:\Pyth
on32\PC -c C:\cython-0.14.1\Cython\Plex\Scanners.c -o c:\cython-0.14.1\cython\pl
ex\scanners.o
error: command 'gcc' failed: Permission denied

I tried the same thing with cygwin and I get the same error. I have restarted my computer and tried again, still same error.

Any and all help would be appreciated, since I spent an entire day on this to no avail.

See Get "Access is denied" when trying to compile with g++ from command line. Cygwin . This fully addresses your question. The issue is apparently symlinks (as i learnt today much to my discomfiture).

The "Permission denied" is still a good way to look. It can happen because:

  1. the gcc command is not executable (weird, but are you able to type "gcc --version" and get the output?)
  2. the destination path "c:\cython-0.14.1\cython\plex\" is not available or not writable. If you have install it with administration right and use with user right, maybe it's the case. Try to give access to everyone here. (disclamer: i'm not a windows guy ^^)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM