Cannot import ft2font on Mac OSX

I followed your instructions and re-built, and I get the same error.

I also ran “nm” and I get results that look like this:

U _FT_Attach_File

U _FT_Done_Face

U _FT_Done_FreeType

U _FT_Done_Glyph

U _FT_Get_Char_Index

U _FT_Get_First_Char

U _FT_Get_Glyph

U _FT_Get_Glyph_Name

U _FT_Get_Kerning

U _FT_Get_Name_Index

U _FT_Get_Next_Char

U _FT_Get_PS_Font_Info

U _FT_Get_Postscript_Name

U _FT_Get_Sfnt_Name

U _FT_Get_Sfnt_Name_Count

U _FT_Get_Sfnt_Table

U _FT_Glyph_Get_CBox

According to the nm man page, the “U” means that “_FT_Attach_File” is undefined.

Is there some sort of switch in the makefile that will define these symbols?



On Mar 2, 2010, at 9:11 AM, Tony S Yu wrote:

On Mar 2, 2010, at 9:39 AM, Michael Hearne wrote:

Using the svn build from 2-25:
matplotlib.version = 1.0.svn
Python from Enthought:
Python 2.6.4 – EPD 6.0.0 (64-bit)

I get the following errors when I try to import ft2font:
Traceback (most recent call last):
File “./”, line 3, in
from matplotlib import ft2font
e-packages/matplotlib/, 2): Symbol not found: _FT_Attach_File
Referenced from:
Expected in: flat namespace

Did you do a clean install, or build over an old build?

I’ve gotten this error when building over an old build. I usually clean out the mpl directory (where is found) with the following terminal commands:

$ make clean

$ find . -name ‘*.so’ | xargs rm


My code looks like this:
#!/usr/bin/env python

from matplotlib import ft2font

print ‘Hello world’

Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
Matplotlib-devel mailing list