Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Pillow/PIL on Mavericks

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.

like image 648
Tyler Sebastian Avatar asked Mar 11 '14 19:03

Tyler Sebastian


People also ask

Is PIL and Pillow the same?

Support for Python Imaging Library got discontinued in 2011, but a project named pillow forked the original PIL project and added Python3. x support to it. Pillow was announced as a replacement for PIL for future usage.

How do I install Python Pillow package?

The simplest way to install Pillow in PyCharm is to open the terminal tab and run the pip install Pillow command . Here's a screenshot of the two steps: Open Terminal tab in Pycharm. Run pip install Pillow in the terminal to install Pillow in a virtual environment.


4 Answers

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
like image 141
jussi Avatar answered Oct 15 '22 10:10

jussi


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

like image 32
mrgnw Avatar answered Oct 15 '22 12:10

mrgnw


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.

like image 30
Javier Avatar answered Oct 15 '22 12:10

Javier


Check out brew http://brew.sh

brew tap Homebrew/python
brew install pillow
like image 20
rchapman Avatar answered Oct 15 '22 12:10

rchapman