PIL /JPEG Library: "decoder jpeg not available" PIL /JPEG Library: "decoder jpeg not available" django django

PIL /JPEG Library: "decoder jpeg not available"


I have found this answer from author "edward"

On Ubuntu precise, PIL doesn't find the jpeg library files, even once they are installed. The easiest way to fix this is to make a symlink after you have installed the jpeg dev package. So, I needed an extra step:

for x64 OS

pip uninstall PILsudo apt-get install libjpeg8-devsudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/libpip install PIL

for x32 OS

pip uninstall PILsudo apt-get install libjpeg8-devsudo ln -s /usr/lib/i386-linux-gnu/libjpeg.so /usr/libpip install PIL

I confirm that this is working for me on Ubuntu Linux 12.04.


If you are a Mac user - you need to install Xcode and Command Line Tools. Read how to do this


You need to install jpeg library first and reinstall your PIL. For example, I'm using CentOS, to install libjpeg, I run

sudo yum install -y libjpeg-devel

It depends on what kind of linux you are using. And here you have to remove the old PIL

rm -rf /usr/lib/python2.6/site-packages/PIL-1.1.7-py2.6-linux-x86_64.egg/

Then install the PIL

sudo easy_install PIL


A stronger answer can be found at install pil on virtualenv with libjpeg

For me what finally worked on Ubutu was:

pip uninstall PILsudo apt-get install libjpeg8-devpip install PIL

The Python Imaging Library (PIL) seems really picky about version and location of the jpeg libraries. And because PIL is written in C and compiled, you need the development versions of the library in addition to the runtime versions.