18

I'm getting a strange error when trying to install Pillow using pip/easy_install:

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -I/System/Library/Frameworks/Tcl.framework/Versions/8.5/Headers -I/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/Cellar/freetype/2.5.3/include/freetype2 -I/private/var/folders/c_/r7sp373509jdb6_1xmmzvl9c0000gn/T/pip_build_tills13/Pillow/libImaging -I/System/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.9-intel-2.7/_imaging.o

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

I've read all the symlink answers, I've installed commandline tools, nothing seems to be working. I always get that error.

Tyler Sebastian
  • 9,067
  • 6
  • 39
  • 62
  • possible duplicate of [Can't install PIL after Mac OS X 10.9](http://stackoverflow.com/questions/19532125/cant-install-pil-after-mac-os-x-10-9) – patsweet Mar 11 '14 at 19:32
  • 1
    @patsweet I went through there and tried all the comments. `xcode-select --install` doesn't even work for me - "software isn't available from the update server" – Tyler Sebastian Mar 11 '14 at 19:34
  • have you considered using MacPorts? – MattDMo Mar 11 '14 at 19:41
  • Weird. Is your Path setup to include the commandline tools? Also, how do you have Python installed. I just setup a new MacBook Pro and used Homebrew to setup Python and various other tools and would highly recommend it. – patsweet Mar 11 '14 at 19:42
  • @patsweet yep I use Homebrew. I installed commandline tools manually from Apple's Developer site: https://developer.apple.com/downloads/index.action?=command%20line%20tools# – Tyler Sebastian Mar 11 '14 at 19:44
  • @MattDMo I haven't, people have been having success without it so I'm holding out. – Tyler Sebastian Mar 11 '14 at 19:45
  • The only other thing I can think of is to make sure the `cc` and `gcc` are either in or symlinked in `/usr/bin`. What do you get when you run `which cc` or `which gcc`? – patsweet Mar 11 '14 at 19:53
  • /usr/bin/cc and /usr/bin/gcc – Tyler Sebastian Mar 11 '14 at 19:57

5 Answers5

58

I solved that problem the following way. Propably has something to do with todays Mavericks commandline tools update. Try adding following to the terminal before executing pip install:

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
PlasmaHH
  • 15,673
  • 5
  • 44
  • 57
jussi
  • 581
  • 3
  • 3
  • This solved the problem for me too! Tyler, come back and mark this answer as correct. I'm on 10.8.5 (latest OSX update that fixed the goto fail bug), and encountered the same problem. Anyone know what the actual problem was? – Keenan Apr 01 '14 at 13:52
  • I had this issue for too long and that solves it! Thanks for that :) Note that I had to install it with: pip install PIL --allow-external PIL --allow-unverified PIL – vinyll Apr 09 '14 at 10:08
  • This worked for me on Mavericks. Took me a while to get here though. My linux server didn't even blink at installing this. – joel3000 May 03 '14 at 01:06
13

Run this command in the terminal:

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pillow


More info:

The compiler that comes with Xcode 5.1 treats unknown passed parameters as errors.

We're telling it to ignore those "errors"

source: http://bruteforce.gr/bypassing-clang-error-unknown-argument.html

mrgnw
  • 1,771
  • 2
  • 17
  • 19
  • 1
    Thanks, works for me and solved this problem https://github.com/facebook/screenshot-tests-for-android/issues/41 – durbon Aug 13 '16 at 17:57
5

In addition to @jussi, I had to open terminal and do the following:

    sudo bash
    export CFLAGS=-Qunused-arguments
    export CPPFLAGS=-Qunused-arguments

Only then could properly run 'pip install pillow'

If I didn't run this using a superuser prompt, I would get the following error:

    error: could not create '/Library/Python/2.7/site-packages/PIL': Permission denied

I'm running OSX 10.9.2 with the March 2014 Command Line Tools installed. I also have Homebrew installed if that makes a difference.

Javier
  • 148
  • 8
5

Check out brew http://brew.sh

brew tap Homebrew/python
brew install pillow
rchapman
  • 91
  • 2
1

None of these solutions worked for me. I finally got it installed with help from this post:

I find the same issue trying to build MySQLdb with the latest Xcode and OS updates. Here is a work around that involves removing the flag from the python installation.

In /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.py are several places where the -mno-fused-madd flag is set. If you edit this file and remove all of the references to that flag your compilation should work. You need to delete the corresponding _sysconfigdata.pyc file as well - at least on my system that file did not automatically get rebuilt. Note that have to use root access to make those changes.

Community
  • 1
  • 1