Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 6 down vote accepted

PIL is missing libjpeg library.

To install it:

  1. Go to
  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 in your code editor
  4. Replace JPEG_ROOT = None with JPEG_ROOT = libinclude("/usr/local")
  5. Enjoy! Now it works!
share|improve this answer
works perfect.. +1 for wonderful answer – arthankamal Nov 18 '13 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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.