Why am I getting the error: command 'llvm-gcc-4.2' failed with exit status 1

前端 未结 6 2165
慢半拍i
慢半拍i 2020-12-14 09:18

I am setting up os X 10.7.

I am using the default install of Python:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/

I use a Python ba

相关标签:
6条回答
  • 2020-12-14 09:37

    I had the exact same problem when I upgraded from OSX 10.6 to 10.7. If you upgrade to 10.7 from 10.6, your version of Python may go from 2.6 to 2.7 and a result you may need to re-install most of your python packages.

    Here's what worked for me:

    1. Install the latest version of XCode from the App Store
    2. Inside XCode, go to Preferences -> Downloads -> Components
    3. download the Command Line Tools

    That's all you need to do. Try to install again in a new shell. The command line tool installation will put llvm-gcc-4.2 into /usr/bin which should be in your default path. The installation also takes care of library paths and stuff that you don't really want to know about unless something breaks.

    10.9 edit

    If you're running 10.9 or higher, I think you might be able to run this from the command line instead to install the command line tools:

    xcode-select --install
    

    I haven't verified that this is an actual fix to the problem.

    0 讨论(0)
  • 2020-12-14 09:40

    Using OS X 10.7.5 (Lion)

    I tried the XCode solution, but my gevent pip installation still wasn't successful. Then, I tried building libevent from source but still no success with gevent installation. However, after I did

        brew install libevent
    

    I was able to successfully install gevent with

        sudo pip install gevent
    

    (Note: greenlet is also a dependency for gevent, so you may try installing it with pip as well. It was already installed on my machine.)

    0 讨论(0)
  • 2020-12-14 09:41

    Alternative to installing Xcode, install GCC and related tools via:

    https://github.com/kennethreitz/osx-gcc-installer

    0 讨论(0)
  • 2020-12-14 09:47

    Sounds to me you ran into this issue. The thread shows a variety of solutions.

    Hope that helps.

    0 讨论(0)
  • 2020-12-14 09:55

    All of the suggestions here (Xcode command line options, and Kenneth Reitz' stuff) didn't work for me (I am on Mac OS X 10.7.5, Xcode 4.6.3).

    What helped in the end was altering the cflags options in the mysql_config file (There were errors about 'unreconized command line options' while trying to 'sudo pip install MySQL-python').

    See this post: cc1: error: unrecognized command line option "-Wno-null-conversion" within installing python-mysql on mac 10.7.5

    0 讨论(0)
  • 2020-12-14 09:56

    The fix is quite simple. Check out the following blogpost. http://waqasshabbir.tumblr.com/post/19073648382/llvm-gcc-4-2-exe-error-on-mac-osx-lion-when-building

    0 讨论(0)
提交回复
热议问题