发出在OSX 10.6以及gcc 4.0和4.2上安装Python模块的问题

问题描述

|| 我运行sudo python setup.py install来安装Mongrel2 Python支持,但是这样做失败:-
> Installed
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
> packages/m2py-1.0beta7-py2.7.egg
> Processing dependencies for
> m2py==1.0beta7 Searching for storm
> Reading
> http://pypi.python.org/simple/storm/
> Reading https://storm.canonical.com
> Reading
> https://launchpad.net/storm/+download
> Best match: storm 0.18 Downloading
> http://launchpad.net/storm/trunk/0.18/+download/storm-0.18.tar.bz2
> Processing storm-0.18.tar.bz2 Running
> storm-0.18/setup.py -q bdist_egg
> --dist-dir /tmp/easy_install-SLExAI/storm-0.18/egg-dist-tmp-kQRcFq In file included from
> /usr/include/architecture/i386/math.h:626,>                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 storm/cextensions.c:23:
> /usr/include/AvailabilityMacros.h:108:14:
> warning: #warning Building for Intel
> with Mac OS X Deployment Target < 10.4
> is invalid.
> /usr/libexec/gcc/powerpc-apple-darwin10/4.0.1/as:
> assembler
> (/usr/bin/../libexec/gcc/darwin/ppc/as
> or
> /usr/bin/../local/libexec/gcc/darwin/ppc/as)
> for architecture ppc not installed
> Installed assemblers are:
> /usr/bin/../libexec/gcc/darwin/x86_64/as
> for architecture x86_64
> /usr/bin/../libexec/gcc/darwin/i386/as
> for architecture i386 lipo: can\'t open
> input file: /var/tmp//ccByYCOo.out (No
> such file or directory) error: Setup
> script exited with error: command
> \'gcc-4.0\' Failed with exit status 1.
然后,我使用sudo CC = / usr / bin / gcc-4.2 python setup.py install重新运行它,但结果相同。 我安装了Python 2.7.1,并在OSX 10.6上运行     

解决方法

        看来您已经安装了Xcode 4,并且可能已经从python.org安装了传统的仅32位,向后兼容的Python 2.7.1。不幸的是,两者并不能很好地融合在一起。 Python是使用Xcode 3构建的,并且需要Xcode3。您可以备份到Xcode 3,或者更好的是,从此处安装64位/ 32位Python 2.7.x(BTW刚刚发布了2.7.2)。