2013-02-02 31 views
0

我在Windows Powershell中使用Python 2.7(我設置了環境以便使用Python)。試圖構建一個Cython文件 - 獲取錯誤(Python 2.7,Windows 7 64位)

我安裝了Cython(使用Windows安裝程序)。

我試圖通過製作一個簡單的「Hello World」的擴展遵循用Cython網站上的教程,但是當我嘗試建立擴展我得到這個錯誤:

dllwrap: gcc exited with status 1 
error: command 'dllwrap' failed with exit status 1 

如何解決這樣我可以通過C擴展優化我的python代碼?

+0

是否有任何相關錯誤數據上面狀態1'線退出了'GCC?它退出的事實並不能提供足夠的信息。 –

+0

你好,這裏是其餘的代碼: –

+0

可能的重複http://stackoverflow.com/q/5439160/1947535 –

回答

0

以下是錯誤代碼的其餘部分:

Windows PowerShell 
Copyright (C) 2009 Microsoft Corporation. All rights reserved. 

PS C:\Users\Pinky> cd Programming 
PS C:\Users\Pinky\Programming> python setup.py build_ext --inplace 
running build_ext 
skipping 'helloworld.c' Cython extension (up-to-date) 
building 'helloworld' extension 
C:\MinGW\bin\gcc.exe -mdll -O -Wall -IC:\Python27\include -IC:\Python27\PC -c helloworld.c -o build\temp.win32-2.7\Relea 
se\helloworld.o 
writing build\temp.win32-2.7\Release\helloworld.def 
C:\MinGW\bin\dllwrap.exe -mdll -static --output-lib build\temp.win32-2.7\Release\libhelloworld.a --def build\temp.win32- 
2.7\Release\helloworld.def -s build\temp.win32-2.7\Release\helloworld.o -LC:\Python27\libs -LC:\Python27\PCbuild -lpytho 
n27 -lmsvcr90 -o C:\Users\Pinky\Programming\helloworld.pyd 
helloworld.exp: file not recognized: File format not recognized 
collect2: ld returned 1 exit status 
dllwrap: gcc exited with status 1 
error: command 'dllwrap' failed with exit status 1 
PS C:\Users\Pinky\Programming> 
+0

Setup.py是應該的C代碼(或東西),並把我的蟒蛇文件轉換爲Cython擴展。它來自本教程:http://docs.cython.org/src/userguide/tutorial.html –

+0

此答案可能與您有關http://stackoverflow.com/a/11152705/1947535 –

+0

它仍然無法正常工作。我把Ming/bin放在我的環境路徑的開始附近,從compiler.py中刪除了-mno-cygwin ..它仍然給我錯誤。 –