I've got error which is generated by PIL when I trying to process jpg-images: Python Imaging Library (PIL) Decoder jpeg not available.

How to fix this problem?

2 Answers 2


PIL is missing libjpeg library.

To install it:

  1. Go to http://www.ijg.org/files/jpegsrc.v8c.tar.gz
  2. Unpack this package and cd to the unpacked folder cd ~/Downloads/jpeg-8c
  3. Compile it:
  4. Then install: sudo make install

But PIL still can't find library. Now you need to reinstall it:

  1. Uninstall pil (if you instlled it with pip, just type sudo pip uninstall pil)
  2. Download PIL, unpack it and move to source folder.
  3. Now open setup.py in your code editor
  4. Replace JPEG_ROOT = None with JPEG_ROOT = libinclude("/usr/local")
  5. Enjoy! Now it works!
  • works perfect.. +1 for wonderful answer Commented Nov 18, 2013 at 15:17

You could also install it from MacPorts. They have PIL for several versions of Python.

py-pil @1.1.7 (python, graphics)
    Python Imaging Library

py24-pil @1.1.7 (python, graphics)
    Python Imaging Library

py25-pil @1.1.7 (python, graphics)
    Python Imaging Library

py26-pil @1.1.7 (python, graphics)
    Python Imaging Library

py27-pil @1.1.7 (python, graphics)
    Python Imaging Library

Check out the site for how to install MacPorts, then just type sudo port install py-pil (or one of the other versions, such as py27-pil). Wait a while and you should have a working PIL, assuming you use the version of Python for which the PIL was installed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .