Last Updated: February 25, 2016
·
6.269K
· davividal

IOError: decoder jpeg not available under Python Virtualenv

When using PIL/Pillow under virtualenv, an IOError shows up.

To solve it under Ubuntu 12.10, install the development headers you're going to need/use:

sudo apt-get install libjpeg8-dev

Link the shared object to /usr/lib, so pip can find it:

sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib

Now, (re)install pil and you're done!

pip uninstall pil
pip install pil

Thanks to http://ubuntuforums.org/showthread.php?t=1751455&page=2