Python Tutorial 42 -

+1 Filipe da Silveira · March 4, 2015
I am new to the forum and I am not used to the rules yet, but I hope someone can answer my question. I was following Bucky's Python 3.x tutorials with no problems so far. But when I got to Tutorial - 42 - Pillow, I started to have an issue and Pycharm is stating the following:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/PIL/", line 413, in _getdecoder
    decoder = getattr(core, decoder_name + "_decoder")
AttributeError: 'module' object has no attribute 'jpeg_decoder'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/filipebcs/PycharmProjects/tutorial/", line 9, in <module>
    cropped_img = img.crop(area)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/PIL/", line 1012, in crop
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/PIL/", line 200, in load
    d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/PIL/", line 417, in _getdecoder
    raise IOError("decoder %s not available" % decoder_name)
OSError: decoder jpeg not available

So, I searched the Internet for a solution and I found out that I needed to reinstall the jpeg libraries. I followed some advices that I found on, but it didn't work. I am using a mid 2014 Macbook Pro Retina 15 with OS X 10.10.2 installed. I would really appreciate it if anyone could help me.

Post a Reply


Oldest  Newest  Rating
0 Bernard Pyc0d333 Parah · March 4, 2015
have you tried uninstalling PIL?
then installing pillow, because to the best of my knowledge, PIL is no longer maintained.

And from your post I think you are using PIL,
rm -rf /usr/lib/python2.7/site-packages/PIL
rm -rf /usr/lib/python2.7/site-packages/PIL.pth

to remove the PIL packages.

Then install pillow 

pip uninstall Pillow
pip install Pillow
0 Filipe da Silveira · March 5, 2015
Bernard Pyc0d333 Parah, just tried doing what you suggested, but it didn't work. Thanks for the suggestion though...
  • 1



This section is all about snakes! Just kidding.

Bucky Roberts Administrator