Shell Person Help me keep the shell people alive.


Easy Install Error “unable to execute clang” on Mountain Lion

Recently I've been getting the error

error: Setup script exited with error: command 'clang' failed with exit status 1

when trying to install various Python libraries using Easy Install on OSX Mountain Lion (with installed). This happened recently trying to install psycopg2, but I've seen it before when trying to install lxml.

server:Desktop shellperson$ sudo easy_install psycopg2
Searching for psycopg2
Best match: psycopg2 2.4.5
Processing psycopg2-2.4.5.tar.gz
Running psycopg2-2.4.5/ -q bdist_egg --dist-dir /tmp/easy_install-TUzBu0/psycopg2-2.4.5/egg-dist-tmp-wjxjYJ
no previously-included directories found matching 'doc/src/_build'
unable to execute clang: No such file or directory
error: Setup script exited with error: command 'clang' failed with exit status 1

Fixed the problem by first installing Xcode from the App Store, then installing Command Line Tools from the Downloads section of Xcode's Preferences screen.

UPDATE: Now on Mavericks you can install Command Line Tools using the following command:

xcode-select --install


Comments (10) Trackbacks (0)
  1. I had same error on my macbook with osx 10.8.2. Thank you!

  2. Many thanks to perfect advice.
    I’ve just resolved MySQL-Python installing!

  3. Very thanks!

  4. First Google link checked = solution.

    I love moments like this, cheers!

  5. There has to be a smaller way.

  6. Is there a way to install clang without the enormity of xcode?

  7. Thanks for this, helped my clang problem as well

  8. Thanks!
    That helped me a lot!

  9. This was great help!

  10. This worked for me! Thanks for the post.

Leave a comment

No trackbacks yet.