I tried installing PIL (Python Imaging Library) on Mavericks recently and ran into a few problems. Normally this should be enough:
sudo pip install pil
However, it failed on the "cc" command. It turns out I didn't have the compiler installed. This is provided with the Xcode command line tools which I was missing. Some articles I found recommended doing just:
xcode-select --install
This didn't work for me, I got a message saying that the software wasn't available in the update servers. Here's what you have to do:
- Open up Xcode
- Go to the application menu > Open Developer Tool > More Developer Tools
- This will bring you to Apple's developer website
- Register as a developer if you haven't already
- When finished you'll see a list of tools to download, choose the latest command line tools
- Install
After that I tried installing PIL again using pip but it was still failing, this time with a different error:
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1
----------------------------------------
Cleaning up...
After googling a little bit I found this stackoverflow page - http://stackoverflow.com/questions/22313407/clang-error-unknown-argument-mno-fused-madd-python-package-installation-fa (opens in new window/tab) - that provides a few solutions. In my case this is what worked:
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install psycopg2
Try it out yourself! If it doesn't work check out that stackoverflow page, it has some good tips.
Leave a Reply