I see this question asked all over the internet, and I\'ve tried following them all, but I still can\'t get PIL to work.
I tried symbolically linking the zlib, jpeg, et
Try reinstalling from scratch:
Look for lib/pythonXX/site-packages/PIL. Delete all this directory along with the file PIL.pth. This should completely remove te package.
Unpack the PIL installation files from the *tar.gz you downloaded.
Add the directories where your jpeg library is, with add_directory(...) as you did before. (Use ldconfig -P | grep jpeg to find where the libraries are).
Retry python setup.py build, then python setup.py install. Test it.
My experience was:
Not performing step 2 did not rebuild the package. Not performing step 3 was the root cause. Not performing step 1 may have played a part.
This seems to be a bug in PIL installation, not in Ubuntu's or any distro's package structure.
And just for the record: it is quite common to have more than one Python version installed on a system, which makes it necessary to install packages manually. Some people have a 2.x with a 3.x for experimenting, shared hostings have 2.5s and applications need a 2.7, just to give two examples.