我很努力在Windows 7 x64上安裝Cython。我下載並安裝了。創建一個distutils.cfg給Distutils的文件夾包含以下內容:Cython無法在Windows 7 x64上編譯
[build]
compiler = mingw32
添加C:\MinGW\bin
環境變量後,我打電話easy_install Cython
但我得到以下錯誤。因爲所有這些編譯的東西(或者我應該說sh * t?)對我來說太新了,所以在網上瀏覽並沒有給我有用的解析。
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
任何想法什麼是錯的?謝謝 !
UPDATE: 我用dlltools創建libpython27.a,然後再次嘗試構建Cython,它只是工作正常! 但現在,調用cython.exe提供了這樣的錯誤:
ImportError: DLL load failed, %1 is not a valid Win32-executable.
我想這是因爲我使用Pythonx64但MINGW32編譯器? 那麼,我怎樣才能編譯它爲X64?
@lance你改變了什麼? //標題。 –
標題。您可以通過點擊上面我的頭像上方的「編輯」一詞後面直接出現的「X mins ago」文本來查看修訂修改摘要。 – lance
太棒了,不知道xD謝謝 –