My Blog List

Thursday, February 9, 2012

Ubuntu PIL JPEG support

from: http://dimamoroz.com/blog/3-ubuntu-pil-jpeg-support/


Ubuntu PIL JPEG support


Got an IOError exception, while trying to process image using PIL, with a next error message:

encoder jpeg not available

PIL is installed within python virtual environment. Figured out, I have no development files for libjpeg installed, so PIL compiles without JPEG support.

The solution is to:

$ sudo apt-get install libjpeg62-dev

Notice: 62 is from libjpeg version 6.2, so it may vary.

Finally, recompile PIL:

pip install -U PIL

PIL has JPEG support for now and everything works like a charm.

/*************************************
I also did this before this work:
************************************/

I had the same problem, but I needed to make symbolic links to find the needed libraries:
$ cd /usr/lib
$ sudo ln -s x86_64-linux-gnu/libjpeg.so
$ sudo ln -s x86_64-linux-gnu/libz.so
$ sudo ln -s x86_64-linux-gnu/libfreetype.so

No comments:

Post a Comment