GCC错误:命令'gcc-4.0'失败,退出状态1
我正在尝试在虚拟环境中安装Fabric,使用的是Django 1.3.1和OS X Lion,Xcode版本是4.2。这个错误似乎很常见,但我找不到在使用Python 2.7和Xcode 4.2时的解决办法。
我的环境是:
Python 2.7 (r27:82508, 2010年7月3日, 21:12:11) [GCC 4.0.1 (苹果公司构建 5493)]
我该如何执行gcc-4.0,而不是gcc-4.0.1呢?
谢谢!
完整的Fabric安装过程和错误信息:
Requirement already satisfied (use --upgrade to upgrade): fabric in ./lib/python2.7/site-packages/Fabric-0.1.0-py2.7.egg
Requirement already satisfied (use --upgrade to upgrade): paramiko>=1.7,<2.0 in ./lib/python2.7/site-packages/paramiko-1.7.7.1-py2.7.egg (from fabric)
Downloading/unpacking pycrypto>=2.1 (from paramiko>=1.7,<2.0->fabric)
Running setup.py egg_info for package pycrypto
Installing collected packages: pycrypto
Running setup.py install for pycrypto
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Hash.MD2' extension
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch ppc -arch x86_64 -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/MD2.c -o build/temp.macosx-10.5-fat3-2.7/src/MD2.o
unable to execute gcc-4.0: No such file or directory
error: command 'gcc-4.0' failed with exit status 1
Complete output from command /Users/emilepetrone/Sites/newsite/salesapp/bin/python -c "import setuptools;__file__='/Users/emilepetrone/Sites/newsite/salesapp/build/pycrypto/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /var/folders/hv/yjvyz6g96xd4c4nbg3hgtk9c0000gn/T/pip-R0wRzk-record/install-record.txt --install-headers /Users/emilepetrone/Sites/newsite/salesapp/bin/../include/site/python2.7:
running install
running build
running build_configure
running build_py
running build_ext
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Hash.MD2' extension
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch ppc -arch x86_64 -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/MD2.c -o build/temp.macosx-10.5-fat3-2.7/src/MD2.o
unable to execute gcc-4.0: No such file or directory
error: command 'gcc-4.0' failed with exit status 1
3 个回答
0
如果这对你有帮助的话,我用符号链接解决了这个烦人的问题,我觉得这也能帮到你。我写这个的时候是考虑到我用的gcc版本是4.2:
cd /usr/bin
rm cc gcc c++ g++
ln -s gcc-4.2 cc
ln -s gcc-4.2 gcc
ln -s c++-4.2 c++
ln -s g++-4.2 g++
ln -s gcc-4.2 gcc-4.0
就这样!
0
奇怪,我现在还在用OS X雪豹系统,当我输入gcc-4.0时,出现了:
i686-apple-darwin10-gcc-4.0.1: no input files
所以我猜实际的版本是4.0.1,但可执行文件的名字是gcc-4.0。
也许你可以试着创建一个名为gcc-4.0的链接,让它指向你的可执行文件(4.0.1)。
1
我在OSX 10.7上也遇到了同样的问题。我的解决办法是:
cd /usr/bin
sudo ln -s gcc gcc-4.0
我下载的MySQL-python版本需要用到gcc-4.0,而gcc已经是指向苹果自带的gcc版本的链接。
顺便说一下,确保你已经安装了xcode和命令行工具哦。