Alireza Farahani
Alireza Farahani

Reputation: 2539

Python 3 "The _imagingft C module is not installed"

I want to use django-simple-captcha in my web site. I went through installation guide in official site but captcha image doesn't load in borrowser and this error appears in console: 500 (INTERNAL SERVER ERROR)

Then I ran the "python3 manage.py test captcha" command in termianl (I'm working on mint 15) and get this error: ImportError: The _imagingft C module is not installed

What's the reason? (This solution didn't work for me )

Upvotes: 1

Views: 4866

Answers (2)

Manu Prana
Manu Prana

Reputation: 1

This solved my problem of trying to start mintinstall in Mint 17. The error I had was the same:

"ImportError: The _imagingft C module is not installed"

After uninstalling pil and renaming its directory and installing Pillow, mintinstall could be started again.

For me, using mintinstall is important because it allows me to install packages from Mint repositories from within security levels 1,2,3.

apt-get / synaptic / aptitude, instead, would install packages regardless of the Mint security level, thus installing potentially unwanted/unsafe packages from Mint levels 4,5

Regards

Upvotes: 0

user2059857
user2059857

Reputation: 1401

the original pil package is not yet compatible with python3, So instead use pillow a fork of pil

Warning PIL and Pillow currently cannot co-exist in the same environment. If you want to use Pillow, please remove PIL first.

first uninstall and remove your old PIL directory (if it exists)

sudo pip uninstall pil
sudo rm -rf /usr/local/lib/python3.2/dist-packages/PIL

install dependencies

sudo apt-get install libfreetype6-dev

now install pillow

pip install Pillow

make sure u have installed pillow in your /usr/local/lib/python[VERSION]/dist-packages/ if it is successfully installed you should see 2 directories like Pillow-2.4.0-py3.2.egg-info and PIL

see here for more details and other platforms

Upvotes: 4

Related Questions