I\'ve just updated my Mac OS to 10.9 and I discovered that some (all?) of my Python modules are not here anymore, especially the Image one.
So I try to execute
Reusing @DmitryDemidenko's answer that is how it worked for me:
ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11 /usr/local/include/X11
and then
sudo pip install -U PIL --allow-external PIL --allow-unverified PIL
I had a similar problem: Installing pillow failed with clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
, installing command line tools failed with Can't install the software because it is not currently available from the Software Update server.
, and even after installing the command line tools manually, the compilation of PIL failed.
This happens cause clang under the newest version of xcode doesn't warn on unknown compiler flags, but rather stop the compilation with a hard error.
To fix this, just run export ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future"
on the terminal before trying to compile (installing pil).
I was having the following error
building 'PIL._imagingft' extension
_imagingft.c:62:10: fatal error: 'freetype/fterrors.h' file not found
#include <freetype/fterrors.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
The solution to this was to symlink freetype2 to freetype and this solved the problem.
A more complete solution requires the installation of the Xquartz X11 subsystem that has been built outside of Apple for several years now. Here are the steps I used to get it all working
sudo pip install pillow
ln -s /usr/local/include/freetype2 /usr/local/include/freetype
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pil
Found the solution ... You've to symlink X11 like this ln -s /opt/X11/include/X11 /usr/local/include/X11
and then sudo pip install pil
should work.