Skip to content Skip to sidebar Skip to footer

No Module Named _imagingft

I have this problem: No module named _imagingft I have installed PIL, but it still does not work. I use OSX. I'm trying to install this module for Django Simple Captcha.

Solution 1:

Installing Pillow over existing PIL solved the issue for me:

$ sudo easy_install PIL
$ sudo easy_install Pillow

Solution 2:

The suggest of Cristopher works very well for me.

Details follow: 1. Uninstall existing Python Imaging Library

  1. Download and extract the source version (from here http://effbot.org/downloads/Imaging-1.1.6.tar.gz)

  2. Install freetype2 library (you need freetype cause _imagingft handles TrueType fonts for captcha)

  3. Modify setup.py (in PIL extracted source folder)to match the freetype2 library (e.g. on my VPS with Centos I've changed line 'FREETYPE_ROOT = None' to 'FREETYPE_ROOT = "/usr/local/include"')

  4. Build PIL (python setup.py build) and verify that Freetype2 support is ok

  5. Install PIL (python setup.py build)

  6. After installing you could verify existence of library, opening python console and typing 'import instructions for _imagingft library'.

If you use ubuntu you can use following manual: http://helloworld.infobart.com/compiling-pil-on-ubuntu-natty

Solution 3:

Thanks to a combination of resources (credit at the end) I've put together the following script, which works for me but YMMV. (Please check it carefully before running. It may have bugs that'll eat your liver, shave your cat, and run your car on leaded fuel):

#!/bin/bash

pip-2.6 uninstall PIL
# Just in case there's a virtualenv someplace:
pip uninstall PIL
# And forcibly clean up PIL as wellrm -rf /Library/Python/2.6/site-packages/PIL*

if [ ! -d "/usr/X11/include/freetype2" ];thenecho"You need to have XCode installed with the freetype libraries"exit 1
fi# Ok we're good to install ...# Freetype is installed by XCode, so let's link to that for PIL's# setup.py to know where to find thingsln -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 

pip-2.6 install PIL
# OR# pip-2.6 install http://effbot.org/downloads/Imaging-1.1.7.tar.gz

Credits:

Solution 4:

Looks like your PIL install didn't support Freetype. You may be missing some Freetype libraries and so your PIL install skipped support for it.

Freetype is the technology for handling fonts.

Solution 5:

I was struggling with this myself. The solution is to install Pillow instead of PIL.

Excerpts From https://pypi.python.org/pypi/Pillow/2.0.0:

Pillow is the "friendly" PIL fork by Alex Clark and Contributors. PIL is the Python Imaging Library by Fredrik Lundh and Contributors.

PIL is not setuptools compatible. ... Also, PIL's current bi-yearly (or greater) release schedule is too infrequent to accomodate the large number and frequency of issues reported.

The binary distribution for Windows also includes _imagingft. You no longer need to build your own from sources.

Download the installer packages from: https://pypi.python.org/pypi/Pillow/2.0.0#downloads

Or simply install with pip install pillow

Post a Comment for "No Module Named _imagingft"