Fixing PIL IOError

I got pil installed (call sudo easy_install pil) on my debian system. After creating some tasks involving JPEGs I got this error:

IOError: decoder jpeg not available

I found a simple workaround to reinstall pil. Make sure you remove every source of PIL from your system.

Here is what I’ve done:

First, remove the old installation:

sudo rm -rf /usr/lib/python2.6/site-packages/PIL
    sudo rm /usr/lib/python2.6/site-packages/PIL.pth

Download sources again, extract and build them:

wget http://effbot.org/downloads/Imaging-1.1.7.tar.gz
    tar xfv Imaging-1.1.7.tar.gz
    cd Imaging-1.1.7.tar.gz
    python setup.py build_ext -i

Run the included self test:

python selftest.py

If everything is ok, install the package:

sudo python setup.py install
comments powered by Disqus