Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running Ubuntu 11.04. Along with python 2.7 I have also 2.6 and 2.5. I am using 2.5 version to work and deploy my applications on App Engine. I have installed PIL (Python Image library) but despite I have all the dependencies covered it informs me that it cannot support jpeg and the rest of formats. How can I make the libjpeg-dev available to my custom python installation?

share|improve this question
I managed to make them available by adding their path to ./configure script. – topless Sep 3 '11 at 12:34
up vote 0 down vote accepted

The PIL file if you are trying to install with easy_install the ./configure script is not available. If you open the in the first lines somewhere are the paths for Jpeg support zlib support etc. I set their values according to my paths of the installed libraries. So the looks like this before executing it:

 37 JPEG_ROOT = "/usr/lib"
 38 ZLIB_ROOT = "/usr/lib/zlib/lib"
 39 TIFF_ROOT = None
 40 FREETYPE_ROOT = "/usr/lib/i386-linux-gnu/"

I have manually installed zlib under /usr/lib/zlib to serve my needs.

The of PIL will recognize the available libraries. Recompile PIL and everything is set!

share|improve this answer

I found it simpler/nicer to add symlinks to the non-standard Ubuntu library locations:

sudo ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib/
sudo ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib/
sudo ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib/

(your .so locations may vary; try locate etc to find them if necessary)

Reinstalling PIL after fixing these worked fine for me.

-- also simpler for virtualenv installations where isn't readily editable

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.