[Fixed]-Decoder JPEG not available error when following Django photo app tutorial

42πŸ‘

βœ…

There are several cases with PIL which lead to a similar experience.
If you have installed PIL out of a virtualenv using

pip install PIL

Then you should have installed the dev versions of libjpeg, libz before.
Assuming you’re on a Ubuntu box, a

pip uninstall PIL
apt-get install libjpeg-dev zlib1g-dev libpng12-dev
pip install PIL

should suffice. You could also install Pillow instead of PIL, it works better with setuptools and can be installed in a virtualenv.

πŸ‘€Steve K

7πŸ‘

I found this worked fine for me:

pip uninstall PIL
pip install Pillow

then I restarted the server:

kill -HUP XXX

where XXX is the process ID of the your server process.

πŸ‘€Hawkz

5πŸ‘

I was already using Pillow and got the same error.
Tried installing libjpeg or libjpeg-dev as suggested by others but was told that a (newer) version was already installed.

In the end all it took was reinstalling Pillow:

sudo pip uninstall Pillow
sudo pip install Pillow
πŸ‘€Dimitris

0πŸ‘

In case you are using Fedora, please do, before doing a pip install Pillow:

yum install libjpeg-devel zlib1g-devel libpng12-devel
πŸ‘€Joepreludian

Leave a comment