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
Instead of symlinking to a specific version of freetype2, do this:
ln -s /usr/local/include/freetype2 /usr/local/include/freetype
This saves you the trouble of recreating the symlink whenever you upgrade freetype2.
With macports, the solution that worked for me:
sudo port install freetype
sudo ln -s /opt/local/include/freetype2 /opt/local/include/freetype
And then re-run the PIL build process.
I've solved this problem with this symlink:
ln -s /usr/local/Cellar/freetype/2.5.1/include/freetype2 /usr/local/include/freetype
I have freetype already installed via homebrew too.
This is caused by a change in the headers of freetype >= 2.1.5. PIL is not using the correct documented way to include the freetype headers, which causes the build to fail now that freetype finally removed the long-deprecated way of including the headers. This problem is documented right at the top of http://freetype.sourceforge.net/freetype2/docs/tutorial/step1.html:
NOTE: Starting with FreeType 2.1.6, the old header file inclusion scheme is no longer supported. This means that you now get an error if you do something like the following:
#include <freetype/freetype.h>
#include <freetype/ftglyph.h>
Please take this problem upstream to the developers of PIL and advise them to use the documented way of including freetype headers:
#include <ft2build.h>
#include FT_ERRORS_H
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With