PIL install driving me mad! With solution!

bleah johnson at pharmacy.arizona.edu
Wed Feb 18 20:28:15 CET 2009

I'm trying to get PIL 1.16 installed on a SUSE SLES10 system, and
cannot, for the life of me, get the thing to compile with jpeg

The libjpeg-devel libraries are installed, and are present in /usr/lib
JUST WHERE SPECIFIED in the setup.py file, and the jpeglib.h incliude
file is present  JUST WHERE SPECIFIED in the setup.py file.

The build process proceeds without errors, yet selftest.py fails with
the error:

tonic:~/html2pdf_sources/Imaging-1.1.6 # python selftest.py
Failure in example: _info(Image.open("Images/lena.jpg"))
from line #24 of selftest.testimage
Exception raised:
Traceback (most recent call last):
  File "./doctest.py", line 499, in _run_examples_inner
    exec compile(source, "<string>", "single") in globs
  File "<string>", line 1, in <module>
  File "./selftest.py", line 22, in _info
  File "PIL/ImageFile.py", line 180, in load
    d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
  File "PIL/Image.py", line 375, in _getdecoder
    raise IOError("decoder %s not available" % decoder_name)
IOError: decoder jpeg not available
1 items had failures:
   1 of  57 in selftest.testimage
***Test Failed*** 1 failures.
*** 1 tests of 57 failed.

Again and again and again.

I found this post  http://blog.tlensing.org/2008/12/04/kill-pil-–-the-python-imaging-library-headache
which provided the solution.

When you run selftest.py in the Imaging-1.1.6 directory, python finds
the PIL.pth and PIL file and directory, respectively and uses those
instead of the properly compiled versions in the python directories.

So PIL is installed, it IS working perfectly, it's selftest.py that's

More information about the Python-list mailing list