Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No module named _imagingft

Tags:

python

django

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.

like image 954
beddamadre Avatar asked Feb 13 '11 15:02

beddamadre


2 Answers

Installing Pillow over existing PIL solved the issue for me:

$ sudo easy_install PIL
$ sudo easy_install Pillow
like image 133
Marcin Górecki Avatar answered Nov 14 '22 22:11

Marcin Górecki


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

like image 21
Yevgeniy Shchemelev Avatar answered Nov 14 '22 23:11

Yevgeniy Shchemelev