我正在尝试在Windows 7 x64上安装Cython。
我已经下载并安装了“自动化MinGW安装程序”。然后,在distutils文件夹中创建了一个distutils.cfg文件,并添加了以下内容:
在将
任何想法出了什么问题吗?谢谢!
更新:我使用dlltools创建了libpython27.a,然后再次尝试构建Cython,它正常工作了!但是现在,调用cython.exe会产生这个错误:
我猜这是因为我使用的是Pythonx64,但MinGW32编译器不支持。那么,我该如何为x64编译它?
[build]
compiler = mingw32
在将
C:\MinGW\bin
添加到环境变量后,我调用easy_install Cython
但是出现以下错误。搜寻互联网并没有给我提供有用的结果,因为这个编译的东西对我来说还很陌生(或者我应该说很烂)。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
任何想法出了什么问题吗?谢谢!
更新:我使用dlltools创建了libpython27.a,然后再次尝试构建Cython,它正常工作了!但是现在,调用cython.exe会产生这个错误:
ImportError: DLL load failed, %1 is not a valid Win32-executable.
我猜这是因为我使用的是Pythonx64,但MinGW32编译器不支持。那么,我该如何为x64编译它?