Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django/PIL Error - Caught an exception while rendering: The _imagingft C module is not installed

I'm trying to run a webapp/site on my machine, it's running on OSX 10.6.2 and I'm having some problems:

Caught an exeption while rending: The _imagingft C module is not installed

Doing import _imagingft in python gives me this:

>>> import _imagingft
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
ImportError: dlopen(/Library/Python/2.6/site-packages/PIL/_imagingft.so,
2): Symbol not found: _FT_Done_Face
 Referenced from: /Library/Python/2.6/site-packages/PIL/_imagingft.so
 Expected in: flat namespace
 in /Library/Python/2.6/site-packages/PIL/_imagingft.so

It's seems that the Freetype library is the one having problems. No errors so far when installing PIL or when I compiled(?) the jpeg and freetype libraries so far.

I'm on django 1.1.1, python 2.6.2.

like image 712
kenok Avatar asked Mar 19 '10 14:03

kenok


2 Answers

Before (re)installing PIL add the following sysmlinks to enable freetype on Mac 10.6 Snow Leopard:

ln -s /usr/X11/include/freetype2 /usr/local/include/
ln -s /usr/X11/include/ft2build.h /usr/local/include/
ln -s /usr/X11/lib/libfreetype.6.dylib /usr/local/lib/
ln -s /usr/X11/lib/libfreetype.6.dylib /usr/local/lib/libfreetype.dylib
like image 54
TimZehta Avatar answered Sep 19 '22 14:09

TimZehta


I've had this problem as well. Couldn't resolve it with PIL 1.1.6 nor with PIL 1.1.7. I installed py26-pil from ports and presto, it works.

sudo port install py26-pil

If you don't have ports, go to http://www.macports.org/

like image 20
miha Avatar answered Sep 23 '22 14:09

miha