11

I just upgraded from Snow Leopard to Lion, and an old python c-extension that I had to update didn't want to compile properly. I don't really know what to do here. Anyone who could help me out so it compiles ok? It compiled just fine back in Snow Leopard.

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
4

3 回答 3

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 位/32 位安装程序,而不是仅安装 32 位安装程序。

于 2011-07-27T05:37:50.753 回答
0

我试图在我的 Mac OS X 10.7 上安装 pynauty,但遇到了这个问题。由于某些原因,Ned Deily 的回答对我没有帮助。我只是想提供另一种方法来解决这个问题,以防有人来到这个页面并且与我处于相同的情况。我解决这个问题的方法是:

在运行“python setup.py build”之前,运行:export ARCHFLAGS="-arch x86_64"

于 2013-06-17T07:37:29.413 回答
0

在 travis 上,我遇到了这个错误。从那以后我一直在使用osx_image: osx10.11,但在过去的几周内,它突然停止工作,出现这个错误。更改osx_image: xcode7.3为我修复了错误。

于 2016-07-24T05:16:10.380 回答