Problem finding libraries when installing python packages that depend on libjpeg62-dev (PIL in this case)

Bug #997756 reported by Benwah
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libjpeg6b (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Problem is that when trying to install PIL in a virtualenv (or potentially system-wide using easy_install, but I can't confirm 100%), the PIL installer cannot find the required libraries even though they have been installed. This is not a problem when using debian for example. This affects both desktop and server edition of Ubutu 12.04)

There is however a manual fix as described here:
http://www.jayzawrotny.com/blog/django-pil-and-libjpeg-on-ubuntu-1110

Basically it involves making the following symlinks:
# ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib
# ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib
# ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib

(Of course after installing the packages libjpeg62-dev, libfreetype12-dev, zlib1g-dev)

Although it's become somewhat routine for me when setting up new python environments, when you don't know about it, it's really frustrating to try to wrap your head around this problem.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: libjpeg62-dev 6b1-2ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-24.37-generic 3.2.14
Uname: Linux 3.2.0-24-generic x86_64
NonfreeKernelModules: fglrx
ApportVersion: 2.0.1-0ubuntu7
Architecture: amd64
Date: Thu May 10 14:56:01 2012
InstallationMedia: Xubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
ProcEnviron:
 LANGUAGE=en_CA:en
 TERM=rxvt-unicode
 LANG=en_CA.UTF-8
 SHELL=/bin/bash
SourcePackage: libjpeg6b
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Benwah (benwah) wrote :
Revision history for this message
Benwah (benwah) wrote :

Ok so this bug has nothing to do with virtualenv, I ahve tried to simply build the python PIL package, and it still cannot find the required jpeg (and other) libraries.

To reproduce:

$ sudo apt-get install libjpeg62-dev zlib1g-dev libfreetype6-dev libpng12-dev python-dev
$ wget http://effbot.org/downloads/Imaging-1.1.7.tar.gz
$ tar xvzf Imaging-1.1.7.tar.gz
$ cd Imaging-1.1.7/
$ python setup.py build

Output:
...
    --------------------------------------------------------------------
    *** TKINTER support not available (Tcl/Tk 8.5 libraries needed)
    *** JPEG support not available
    *** ZLIB (PNG/ZIP) support not available
    *** FREETYPE2 support not available
    *** LITTLECMS support not available
    --------------------------------------------------------------------
...

How to fix:

$ ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib
$ ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib
$ ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib

and then it builds with jpeg / png / freetype support.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in libjpeg6b (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.