2
votes

When I try to install PIL library on Macosx 10.9.2, it's giving following error, how to install it.

$: sudo pip install pillow

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.2/include/freetype2 -I/private/tmp/pip_build_root/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

2
thanks, that helped meNyambaa

2 Answers

2
votes

following line helped me.

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

0
votes

This was because OS10.9 changes its cc compiler, so 'cc' can not compile some python libs. I tried to fix this problem by replacing my cc compiler with older version gcc. First, you should install brew.

$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

and install gcc-4.2

$ sudo brew install apple-gcc42

delete current cc. its just a symbolic link from clang, so you do not need to backup it.

$ sudo rm -f /usr/bin/cc

create new symbolic link, cc -> gcc-4.2

$ sudo ln -s /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 /usr/bin/cc

test if you change it successful.

$ ls -l /usr/bin | grep cc

if it shows

$ cc -> /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2

that means you successfully changed your cc compiler. And you can install your python lib like PIL or pillow.