Installing PIL properly

August 9, 2009...... at 12:41 pm | Posted in Uncategorized | 2 Comments

I love virtualenv and easy_install but using the latter to install PIL has in the past proved problematic as it is often not found. I thought my worries were over when I found this little gem on the internet:

easy_install –find-links http://www.pythonware.com/products/pil/ Imaging

But today while debugging mail-server issues I was left scratching my head by a situation where django running over wsgi was finding PIL but runserver wasn’t.

The reason became clear to me after reading http://code.djangoproject.com/ticket/8187 that the problem is that the above method of installing PIL, doesn’t actually install PIL – it installs Imaging (which is a submodule).
Using
pip install http://dist.repoze.org/PIL-1.1.6.tar.gz
gives you a PIL.pth file in your site-packages and the ability to import PIL

Advertisements

2 Comments »

RSS feed for comments on this post. TrackBack URI

  1. mmm I get loads or errors by running this command with pip when gcc tries to compile PIL…

  2. Worked wonders! Great post!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.
Entries and comments feeds.

%d bloggers like this: