[英]gcc-4.2 failed with exit status 1
我一直在寻找这个问题的答案,但我找不到它,所以在这里。
我正在尝试使用以下命令将带有setup.py文件的Uniconvertor安装到MacOS X Lion(Python 2.7.2)中:
python setup.py install
然后我得到以下错误代码:
running install
running build
running build_py
running build_ext
building 'uniconvertor.app.modules.streamfilter' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -g -O2 -DNDEBUG -g -O3 -arch i386 -arch x86_64 -DMAJOR_VERSION=1 -DMINOR_VERSION=1 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/modules/filter/streamfilter.c -o build/temp.macosx-10.6-intel-2.7/src/modules/filter/streamfilter.o
unable to execute gcc-4.2: No such file or directory
error: command 'gcc-4.2' failed with exit status 1
我在Developer / usr / bin文件夹中查找了'gcc-4.2'文件并且它不存在,但是有一个'llvm-gcc.4.2'文件让我觉得我应该从'gcc-4.2更改编译器'到'llvm-gcc.4.2'一个。
我是Mac的新手,我不知道如何修复它。
谢谢。
编辑:
我试过用:
cd /Developer/usr/bin
ln -s llvm-gcc-4.2 gcc-4.2
我得到了更多进步,但随后出现了一个新错误:
running install_lib
creating /Library/Python/2.7/site-packages/uniconvertor
error: could not create '/Library/Python/2.7/site-packages/uniconvertor': Permission denied
这个“权限被拒绝”的原因是什么?
我正在运行它进入管理员帐户,它不会要求输入密码或任何东西。
再次感谢你。
请尝试以下方法:
我可以通过下载其中一个来解决这个问题: https : //github.com/kennethreitz/osx-gcc-installer/releases
对于较新版本的OS X(包括macOS),您只需打开一个终端并输入:
xcode-select --install
尝试sudo python setup.py install
。
命令行实用程序不会要求您升级权限,因此必须在情况需要时以sudo
模式运行(例如,将库安装到全局位置)。
我尝试了@plusjeff的答案,但Xcode 4.6不再在主目录中创建/ Developer文件夹了。
因此我用符号链接对它进行了整理:
sudo ln -s /Applications/Xcode.app/Contents/Developer /Developer
它工作了!
我安装了OSX 10.7.5
希望这可以帮助!
由于运行了过时版本的pip,我收到了这个错误。 我运行pip install --upgrade pip
,错误就消失了。 如果您已经安装了xcode命令行工具并且仍然出现错误,则需要考虑一些事项。
您需要安装Xcode。
转到Xcode - >首选项 - >位置,然后选择命令行工具。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.