The followed works on ubuntu 12.04:
pip uninstall PIL
apt-get install libjpeg-dev
apt-get install libfreetype6-dev
apt-get install zlib1g-dev
apt-get install libpng12-dev
pip install PIL --upgrade
when your see "-- JPEG support avaliable" that means it works.
But, if it still doesn't work when your edit your jpeg image, check the python path !!
my python path missed /usr/local/lib/python2.7/dist-packages/PIL-1.1.7-py2.7-linux-x86_64.egg/
, so I edit the ~/.bashrc
add the following code to this file:
Edit: export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/dist-packages/PIL-1.1.7-py2.7-linux-x86_64.egg/
then, finally, it works!!