Last active
May 7, 2018 17:03
-
-
Save DavidToca/6063298 to your computer and use it in GitHub Desktop.
Install PIL on linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update ; | |
sudo apt-get install libjpeg-turbo8-dev libjpeg8-dev ; | |
sudo apt-get install libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev zlib1g-dev libfreetype6-dev liblcms1-dev libjpeg62-dev; | |
sudo apt-get build-dep python-imaging | |
#PIL cant find the files he needs, so we need to make symlinks to the files he looks for | |
sudo ln -s /usr/lib/`uname -i`-linux-gnu/libfreetype.so /usr/lib/ ; | |
sudo ln -s /usr/lib/`uname -i`-linux-gnu/libjpeg.so /usr/lib/ ; | |
sudo ln -s /usr/lib/`uname -i`-linux-gnu/libz.so /usr/lib/; | |
#be sure you are in the enviroment you need to install PIL (in case you are using virtualenv) | |
pip uninstall PIL ; pip install PIL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I solve the problem according this link http://stackoverflow.com/questions/8915296/python-image-library-fails-with-message-decoder-jpeg-not-available-pil
install libjpeg-dev with apt
sudo apt-get install libjpeg-dev
reinstall pillow
pip install -I pillow
The package libjpeg-dev you says that is necessary install too, is possible that in my system the conflict with libjpeg62 uninstall libjpeg-dev in the last opportunity and I don't know this.
Of any way thanks for your gist about it. It's very useful for me. :)