Python Tutorial 42 -

+1 Filipe da Silveira · March 4, 2015
Hi,
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/Image.py", 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/32_thirty_second.py", line 9, in <module>
    cropped_img = img.crop(area)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/PIL/Image.py", line 1012, in crop
    self.load()
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/PIL/ImageFile.py", 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/Image.py", 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 http://stackoverflow.com/questions/8915296/python-image-library-fails-with-message-decoder-jpeg-not-available-pil, 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

Replies

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

Python

107,342 followers
About

This section is all about snakes! Just kidding.

Links
Moderators
Bucky Roberts Administrator