lipo: 无法识别架构类型:/var/folders/
我在Mac OSX Snowleopard上尝试安装lxml,但一直出现错误:
lipo: can't figure out the architecture type of: /var/folders/
我已经安装了带有10.4 SDK支持的XCode,并且把gcc从4.2改成了4.0.1。
有没有什么线索???我用的是Python 2.6.1和Leopard 1.6.7。
running install
running bdist_egg
running egg_info
writing src/lxml.egg-info/PKG-INFO
writing top-level names to src/lxml.egg-info/top_level.txt
writing dependency_links to src/lxml.egg-info/dependency_links.txt
reading manifest file 'src/lxml.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'lxml.etree.c' under directory 'src/lxml'
warning: no files found matching 'lxml.objectify.c' under directory 'src/lxml'
warning: no files found matching 'lxml.etree.h' under directory 'src/lxml'
warning: no files found matching 'lxml.etree_api.h' under directory 'src/lxml'
warning: no files found matching '*.html' under directory 'doc'
writing manifest file 'src/lxml.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-universal/egg
running install_lib
running build_py
running build_ext
building 'lxml.etree' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -I/usr/include/libxml2 -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.6-universal-2.6/src/lxml/lxml.etree.o -w -flat_namespace
i686-apple-darwin10-gcc-4.2.1: src/lxml/lxml.etree.c: No such file or directory
i686-apple-darwin10-gcc-4.2.1: no input files
powerpc-apple-darwin10-gcc-4.2.1: src/lxml/lxml.etree.c: No such file or directory
powerpc-apple-darwin10-gcc-4.2.1: no input files
i686-apple-darwin10-gcc-4.2.1: src/lxml/lxml.etree.c: No such file or directory
i686-apple-darwin10-gcc-4.2.1: no input files
lipo: can't figure out the architecture type of: /var/tmp//ccCwMxyq.out
error: command 'gcc-4.2' failed with exit status 1
3 个回答
0
我发现通过brew安装python可以很容易避免这些编译问题。如果brew无法链接这个公式,可以强制链接,方法是:
brew link --overwrite python
另外可以参考:http://docs.python-guide.org/en/latest/starting/install/osx/
0
你的Python可能遇到了架构问题。因为Xcode 4做了一些改变(不再支持10.4u SDK和gcc-4.0),所以在10.7 Lion系统上用这个Python来构建C扩展模块就变得不太实际了。你可以选择使用苹果自带的Python 2.7。
/usr/bin/python2.7
你也可以安装这个Python 2.7.3 Mac OS X 64位/32位的安装包。
1
我在用Python 2.7安装milk的时候也遇到了同样的问题。我没有按照Ali Elouafiq的答案解决我的问题,但我成功用系统自带的Python 2.6安装了milk。
所以,也许尝试其他版本的Python,看看能不能成功,是一种比较省钱的办法。