Last Updated: February 25, 2016
·
11.23K
· daspecster

PIL/Pillow IOError: decoder jpeg not available

If you run into IOError: decoder jpeg not available when trying to use PIL or Pillow you can generally resolve this by uninstalling PIL/Pillow and then installing libjpeg-dev, finally reinstalling PIL/Pillow

Debian/Ubuntu

  1. pip uninstall Pillow or pip uninstall PIL
  2. sudo apt-get install libjpeg-dev
  3. pip install Pillow

Redhat/CentOS

  1. pip uninstall Pillow or pip uninstall PIL
  2. sudo yum install libjpeg-devel
  3. pip install Pillow

2 Responses
Add your response

If you're doing this on a production server be sure to restart the app server or you'll not see if this has fixed your issue!

over 1 year ago ·

@timfletcher: Reload is enough, don't need to restart the apache/nginx.
Btw, for Centos 7 :
yum install libjpeg-turbo-devel

Thanks for the article.

over 1 year ago ·