I apologize ahead of time if this topic has already been discussed. My situation seems to vary slightly from the others such that the path to my files is different. When trying to install matplotlib on Mac OS X 10.8.5 the following error is returned:
pip install matplotlib # lots of install details here... /usr/X11/include/ft2build.h:56:10: fatal error: 'freetype/config/ftheader.h' file not found #include <freetype/config/ftheader.h> ^ 1 error generated. error: command 'clang' failed with exit status 1 ---------------------------------------- Cleaning up... Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/matplotlib/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ohMPzS-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/matplotlib Storing debug log for failure in /Users/administrator/Library/Logs/pip.log
My Homebrew has the following installed:
fontconfig gfortran jpeg libtiff pkg-config freetype libpng
And I am using the Mac version of Python 2.7.2 at /usr/bin/python
So I used Finder to search for ftheader.h and it's saying the file is located at:
My questions are:
- Is matplotlib looking for ftheader.h in the wrong place?
- If so, how do I tell it to look in the right place?
- Or, is something else causing the problem?
This seems to have fixed the problem:
sudo ln -s /usr/local/include/freetype2/ /usr/include/freetype
That creates a symlink from /usr/include/freetype to /usr/local/include/freetype2/ (when you click on /usr/include/freetype you will be redirected to /usr/local/include/freetype2/). Before you create the symlink, it's best to verify that the first path is correct on your system. The second path will be created if it does not exist.
After creating the symlink, I tried
sudo pip install matplotlib again and this time it successfully installed. Mucho props to this post for the idea! I will report back if something throws up an error later downstream.
It's also worth noting that a matplotlib binary exists.