在OS X上安装Python扩展时,缺少MacOSX10.4u.sdk错误
我正在尝试在OS X(10.6.4)上安装各种Python扩展,使用的是python.org提供的Python(版本2.6.4)。在编译过程中,特别是在gcc这一步,总是遇到问题。以下是我在编译Cython时遇到的一个示例(顺便说一下,我是为了安装lxml而尝试安装Cython):
In file included from /usr/include/architecture/i386/math.h:626,
from /usr/include/math.h:28,
from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pyport.h:235,
from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:58,
from /tmp/easy_install-Sgn5ep/Cython-0.12.1/Cython/Plex/Scanners.c:4:
/usr/include/AvailabilityMacros.h:108:14: warning: #warning Building for Intel with Mac OS X Deployment Target < 10.4 is invalid.
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/MacOSX10.4u.sdk
Please check your Xcode installation
ld: library not found for -lbundle1.o
ld: library not found for collect2: -lbundle1.o
collect2: ld returned 1 exit status
我在尝试以不同方式安装lxml时也遇到了类似的错误。我试过了西蒙的问题中提到的成功方法,还有lxml网站上的安装说明,但结果都遇到了同样的问题。
我真的需要安装一个旧版的OS X SDK吗?如果需要,我该去哪里找(搜索似乎没有找到任何官方的下载地址)。
或者有没有更好的解决办法,不需要旧版SDK?
1 个回答
0
经过一番不必要的折腾,主要是因为我自己太固执了,最后的问题是通过卸载Xcode然后重新安装解决的。这次安装的时候,记得勾选了支持SDK 10.4的选项。