I want to install PIL on Mavericks using pip but get this error.
_imagingft.c:73:10: fatal error: 'freetype/fterrors.h' file not found
#include <freetype/fterrors.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
My Command Line Tools are installed and up to date and every hint I found didn't help. How can I get this to compile?
EDIT: I just checked, freetype is also already installed via homebrew
I just solved this using the steps described in this Stackoverflow answer. Seems this is Xcode's fault for installing freetype in strange locations.
Instead of symlinking to a specific version of freetype2, do this:
This saves you the trouble of recreating the symlink whenever you upgrade freetype2.
After many attempts, I solved this problem compiling the PIL without freetype support. To do that, I simply unlinked from my $PATH using
brew unlink freetype
and then,pip install PIL==1.1.7
.In my OSx, I found the
.h
file in/opt/local/include/freetype2
direcoty. So, I typeit works
Maybe the best way is to add
/opt/local/include
to your clang's include path.With macports, the solution that worked for me:
And then re-run the PIL build process.
I've solved this problem with this symlink:
I have freetype already installed via homebrew too.