Installing PIL in a virtualenv on Ubuntu 12.04 Precise Pangolin | Blog | Sanders New Media

Our Blog

Installing PIL in a virtualenv on Ubuntu 12.04 Precise Pangolin

The following technique should work for both 32-bit and 64-bit systems.


Install the build dependencies:

sudo apt-get build-dep python-imaging

Symlink the libraries:

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/

Install:

pip install PIL

You should see something like this after it builds:

--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version       1.1.7
platform      linux2 2.7.3 (default, Apr 10 2012, 22:21:37)
              [GCC 4.6.3]
--------------------------------------------------------------------
--- TKINTER support available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
*** LITTLECMS support not available
--------------------------------------------------------------------

This technique based on 64-bit instructions for Natty Narwhal