How to install PIL from ZIP, JPEG, etc. On Ubuntu 11.10

I am trying to import png, which I believe is from PIL. I would also prefer JPEG and others to work as well

I am running Ubuntu 11.10.

now from
I figured out a few things.

I tried

$ sudo apt-get install libjpeg libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev  
pip install PIL  
sudo ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib  
sudo ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib  
sudo ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib  
pip install -U PIL  


where all his / her JPEG, ZLIB, FREETYPE2 were supported by my support not installed

I also went to How do I install PIL on Ubuntu 11.04? and I tried    sudo apt-get install python imaging

and then through the whole and` but still it didn't work
I kept using the jpeg of the PIL encoder is not available . I downloaded the source files from and went to usr / lib using mv then according to stackoverflow instructions I tried to add a line after line 213:

add_directory(library_dirs, "usr/lib")  
sudo python install  


but JPEG, ZLIB, FREETYPE2 were not supported, but now there is another line that said support for LITTLECMS is not installed.

Please help me figure it out.


source to share

3 answers

The repository versions work fine for me 11.10. Have you used:

sudo apt-get install python-imaging

Note the dash between python and image where you have a space. You don't need to manually trigger

or any of these locks unless for some reason you need to build from source. PNG should work out of the box.



On Ubuntu 12.04 I resolved the issue caused by the "canonical" comment

  • Manually loaded PIL
  • Changed JPEG_ROOT to point to jpeg lib location: / usr / lib or / usr / lib / i 386-linux-gnu on x86 and / usr / lib / x 86_64-linux-gnu on x64
  • Cleaned up project (if already built) with python clean --all
  • On x86 and x64 I found that and where in the / usr / local / lib / python 2.7 / dist-packages directory AND also in / usr / local / lib / python 2.7 / dist -packages / PIL ... I removed the first ones because they were loaded before the PIL distribution.
  • python build
  • installing python

This was in the context of using the Django / Mezzanine CMS.



None of these worked for me, Ubuntu 14.04. I had to compile everything from source, but I have to say this was the sweetest of them all. No mistakes. Download from the following links and follow the various READMEs. Make sure you follow the root instructions. Download and install JPEG from . Download and install PNG from . Download and install Freetype from .

Download and install PIL from . In this last step, make sure that in the readme file you can see the ones that are set correctly during

python build_ext -i


In some cases, the following command might tell you something else, but ignore it. python

Greetings. : -)



All Articles