Can’t install PIL on Mavericks (unknown argument: -mno-fused-madd)

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:

  1. Open up Xcode
  2. Go to the application menu > Open Developer Tool > More Developer Tools
  3. This will bring you to Apple's developer website
  4. Register as a developer if you haven't already
  5. When finished you'll see a list of tools to download, choose the latest command line tools
  6. 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 - (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




You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>