Friday, August 3, 2012

matplotlib error [Mac OS X]

Matplotlib 1.1.1 cannot be directly installed via the installer in the dmg image provided in sourceforge, at lease in my case.

I decided to build from source code.

Several libraries are missing in my Mountain Lion.

FreeType: (link)

Deal with:
/usr/local/include/ft2build.h:56:10: fatal error: 'freetype/config/ftheader.h' file not found

after install freetype, a hard link should be made for matplotlib to locate the freetype.
ln -s /usr/local/include/freetype2/freetype/ /usr/include/freetype

LIBPNG: (link)

You can test the matplotlib by importing the pylab module in your python shell.
from pylab import *


  1. It was useful for sk1libs.
    Thank you very much!

  2. Thank Yuan for finding a solution to my broken MacOSX matplotlib build!