2011-07-27 23 views
10

我剛剛從雪豹升級到獅子,和一箇舊的Python C擴展,我不得不更新不想正確編譯。我真的不知道該在這裏做什麼。任何人可以幫助我,所以它編譯好嗎?它在Snow Leopard中編譯得很好。「......無法弄清楚......的架構類型」問題編譯Python的C擴展與海灣合作委員會

Home:folder Me$ python setup.py build 
running build 
running build_ext 
building 'ccookies' extension 
gcc -fno-strict-aliasing -fno-common -dynamic -arch ppc -arch i386 -g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c ccookies.c -o build/temp.macosx-10.3-fat-2.7/ccookies.o 
llvm-gcc-4.2: error trying to exec '/Developer/usr/bin//../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory 
In file included from /usr/include/architecture/i386/math.h:630, 
       from /usr/include/math.h:28, 
       from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyport.h:312, 
       from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:58, 
       from ccookies.c:5: 
/usr/include/AvailabilityMacros.h:109:14: warning: #warning Building for Intel with Mac OS X Deployment Target < 10.4 is invalid. 
lipo: can't figure out the architecture type of: /var/folders/_t/yg4wppss5fv6dkmh89_6ykm40000gn/T//cc3Cgr3v.out 
error: command 'gcc' failed with exit status 255 

回答

9

您似乎在使用32位Python 2.7,可能是從python.org安裝的。由於Xcode 4的變化(10.4u SDK和gcc-4.0的支持下降),在10.7 Lion上使用該Python構建C擴展模塊並不實際。無論是使用Apple提供的Python 2.7(/usr/bin/python2.7),還是安裝用於2.7.2的python.org 64-bit/32-bit installer而不是32位的。

+0

是的,安裝32/64位2.7.2版本解決了它。非常感謝! – c00kiemonster

+0

太好了。順便說一句,如果你打算使用Tkinter或IDLE,你也應該安裝最新的ActiveState Tcl/Tk 8.5。蘋果提供的10.7版本仍然有一些舊的錯誤。 –

+0

感謝提示 – c00kiemonster

0

我試圖在我的Mac OS X 10.7上安裝pynauty,並且我遇到了這個問題。出於某些原因,Ned Deily的回答沒有幫助我。我只是想提供一種方法來解決這個問題,以防萬一有人來到這個頁面,並且與我處於相同的情況。我解決了這個prolem的方法是:

運行「蟒蛇setup.py打造」之前,運行: 出口ARCHFLAGS =「 - 拱x86_64的」

0

在特拉維斯,我得到這個錯誤。我一直在使用osx_image: osx10.11,但它在上幾個星期內突然停止工作,出現這個錯誤。更改爲osx_image: xcode7.3修復了我的錯誤。

相關問題