Python and GCC version



我正试图在我的Mac OS X Lion 10.7.3上构建一些库(如寓言、PIL..)。当我在终端上输入Python解释器时,我有gcc:的4.0.1版本

Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 14:13:39) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin

但有趣的是,如果我输入python2.6,我会得到gcc 4.2.1:

[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.`

我想使用Python(2.7.2版本,因为它是我拥有的最新版本),但在这个Python版本中编译是不可能的。使用命令python setup.py install,我收到错误消息:

unable to execute gcc-4.0: No such file or directory
error: command 'gcc-4.0' failed with exit status 1

这在Mac电脑上正常吗?有人能帮我为Python 2.7.2定义gcc 4.2.1吗?

在sudo su模式下输入此命令export ARCHFLAGS="-arch i686"可以解决问题。别问我为什么!

最新更新