Django / PIL error - an exception is thrown during rendering: _imagingft C module is not installed

I try to run a webapp / site on my machine, it works on OSX 10.6.2, and I am having some problems:

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

Doing the _imagingft import in python gives me the following:

 >>> 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 

The Freetype library seems to have problems. There are still no errors while installing PIL and compiling (?) The jpeg and freetype libraries yet.

I am on django 1.1.1, python 2.6.2.

+7
python django python-imaging-library macos
source share
5 answers

I also had this problem. Unable to resolve it with PIL 1.1.6 and with PIL 1.1.7. I installed py26-pil from ports and presto, it works.

 sudo port install py26-pil 

If you do not have ports, go to http://www.macports.org/

+3
source share

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 
+9
source share

I found a solution for this.

First you need to download Freetype2 http://freetype.sourceforge.net/index2.html and compile it using these instructions http://www.libgd.org/DOC_INSTALL_OSX#Building_freetype2 , then you go and compile libjpeg and PIL http: / /fightingrabbits.com/archives/266

What is it.

+2
source share

With errors, such as usual, because one of the PIL dependencies was not compiled as a universal binary.

Try the following:

  • Download the Freetype framework to this website
  • Download the package for libjpeg8 to this website
  • Remove the files that you originally installed for libjpeg and freetype.
  • Install new packages
  • Delete build folder for PIL
  • Repair and install PIL

But if you want to try compiling a universal binary first, be my guest. My specific problem was actually with libjpeg, and no matter how I compiled it, PIL worked on import _imaging . Therefore, I chose batch versions. I do not think libjpeg or freetype especially benefit from compiling them.

The libjpeg8 package is installed in / usr / local / lib

The freetype package is installed in the / Library / Frameworks folder.

+1
source share

The environment is not configured correctly to create OS X PIL \ libjpeg binaries using easy_install. This guide should help http://fightingrabbits.com/archives/266 - it is for installing Python / Django, but first goes through the necessary PIL setup and works for me on 10.6.x

0
source share

All Articles