Cython will not compile on Windows 7 x64

I am struggling with installing Cython on Windows 7 x64. I downloaded and installed automated MinGW installer . Created by distutils.cfg in the distutils folder with the following contents:

 [build] compiler = mingw32 

After adding C:\MinGW\bin to the environment variables, I called easy_install Cython , but I am getting the following errors. The crash on the Internet really did not give me any useful results, since all this compiling material (or should I say sh * t?) Is so new to me.

 c:\users\niklas\appdata\local\temp\easy_install-dgjjub\cython-0.15\cython\plex\scanners.o:Scanners.c:(.text+0x5d59): undefined reference to `_imp__PyObject_GetAttr' c:\users\niklas\appdata\local\temp\easy_install-dgjjub\cython-0.15\cython\plex\scanners.o:Scanners.c:(.text+0x5dc5): undefined reference to `_imp__PyObject_GetAttr' c:\users\niklas\appdata\local\temp\easy_install-dgjjub\cython-0.15\cython\plex\scanners.o:Scanners.c:(.text+0x5e31): undefined reference to `_imp__PyObject_GetAttr' c:\users\niklas\appdata\local\temp\easy_install-dgjjub\cython-0.15\cython\plex\scanners.o:Scanners.c:(.text+0x5ebc): undefined reference to `_imp__PyObject_Call' c:\users\niklas\appdata\local\temp\easy_install-dgjjub\cython-0.15\cython\plex\scanners.o:Scanners.c:(.text+0x5f08): undefined reference to `_imp__PyDict_New' c:\users\niklas\appdata\local\temp\easy_install-dgjjub\cython-0.15\cython\plex\scanners.o:Scanners.c:(.text+0x5f49): undefined reference to `_imp__PyObject_SetAttr' c:\users\niklas\appdata\local\temp\easy_install-dgjjub\cython-0.15\cython\plex\scanners.o:Scanners.c:(.text+0x5ffe): undefined reference to `_imp__PyErr_Occurred' c:\users\niklas\appdata\local\temp\easy_install-dgjjub\cython-0.15\cython\plex\scanners.o:Scanners.c:(.text+0x6013): undefined reference to `_imp__PyExc_ImportError' c:\users\niklas\appdata\local\temp\easy_install-dgjjub\cython-0.15\cython\plex\scanners.o:Scanners.c:(.text+0x601e): undefined reference to `_imp__PyErr_SetString' c:\users\niklas\appdata\local\temp\easy_install-dgjjub\cython-0.15\cython\plex\scanners.o:Scanners.c:(.text+0x602d): undefined reference to `_imp__PyInt_FromLong' collect2: ld returned 1 exit status dllwrap: gcc exited with status 1 error: Setup script exited with error: command 'dllwrap' failed with exit status 1 

Any ideas on something wrong? Thanks!

UPDATE : I used dlltools to create libpython27.a, and then tried again to build Cython, and it just works great! But now a call to cython.exe causes this error:

 ImportError: DLL load failed, %1 is not a valid Win32-executable. 

I guess this is because I use Pythonx64, but is the MinGW32 compiler? So how can I compile it for x64?

+7
source share
1 answer

There are pre-compiled Cython packages on this site for more on this ).

Do not use MinGW-w64 . As you noticed, the MinGW import library for Python (e.g. libpython27.a) is omitted from the AMD64 Python version. This is intentional. Do not try to do this with dlltool. [...] There were also problems with mingw runtime conflicts with MSVC runtime; this may come from places you don't expect, for example, inside runtime libraries for g ++ or gfortran.

+10
source

All Articles