gcc-4.2 failed with exit status 1

寵の児 提交于 2019-11-26 20:21:12

Try the following:

  1. Install the latest Xcode.
  2. From Xcode's Preferences menu, install the Command Line Tools (Downloads/Components tab).
Ricky

I was able to resolve this by downloading one of these: https://github.com/kennethreitz/osx-gcc-installer/releases

For newer versions of OS X (including macOS), you just need to open up a terminal and type:

xcode-select --install

Try sudo python setup.py install.

Command line utilities will not ask you to escalate privileges and so must be run in sudo mode when the situation requires it (e.g., library installation into a global location).

I tried @plusjeff answer, but Xcode 4.6 does not create a /Developer folder in the main directory anymore.

Therefore I sorted it out with a symlink:

sudo ln -s /Applications/Xcode.app/Contents/Developer /Developer

and it worked!

I have OSX 10.7.5 installed

Hope this helps!

I ran across this issue when installing a python library with pip.

After running xcode-select --install, I was still getting the issue.

So I created a symlink from "gcc" to "gcc-4.2" and that worked for me.

ln -s /Applications/Xcode.app/Contents/Developer/usr/bin/gcc /usr/local/bin/gcc-4.2

pip install --upgrade pip did not help fix the issue for me.

The answer by DanFreak didn't help me either, but it did give me the idea for what actually did work for me.

I got this error due to running an outdated version of pip. I ran pip install --upgrade pip and the error went away. Something to consider if you already have xcode command line tools installed and are still getting the error.

You will need the Xcode installed.

Go to Xcode -> Preferences -> Locations and choose the Command Line Tools.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!