我刚刚从 Snow Leopard 升级到 Lion,我必须更新的旧 python c 扩展不想正确编译。我真的不知道在这里做什么。任何人都可以帮助我,使其编译正常吗?它在 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
您似乎使用的是 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
)或安装python.org 64 位/32 位安装程序 http://python.org/download/对于 2.7.2,而不是仅 32 位的。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)