All posts All posts by this author Paper color Change page color Announcements

PIL "decoder jpeg not available" Debian/Ubuntu

Install required library:

~$ sudo apt-get install libjpeg62-dev zlib1g-dev libfreetype6-dev liblcms1-dev

Download and Extract PIL

~$ wget -c http://effbot.org/downloads/Imaging-1.1.7.tar.gz
~$ tar -zxvf Imaging-1.1.7.tar.gz
~$ cd Imaging-1.1.7

Edit setup.py and set

# for 32bit Debian/Ubuntu
JPEG_ROOT = "/usr/lib/i386-linux-gnu/" 

# for 64bit Debian/Ubuntu
JPEG_ROOT = "/usr/lib/x86_64-linux-gnu"
~$ vi setup.py
# JPEG_ROOT = "/home/libraries/jpeg-6b"
# TIFF_ROOT = "/opt/tiff/lib", "/opt/tiff/include"
#
# If you have "lib" and "include" directories under a common parent,
# you can use the "libinclude" helper:
#
# TIFF_ROOT = libinclude("/opt/tiff")

TCL_ROOT = None
JPEG_ROOT = "/usr/lib/i386-linux-gnu/"
ZLIB_ROOT = None
TIFF_ROOT = None
FREETYPE_ROOT = None
LCMS_ROOT = None

Build PIL

~$ python setup.py build_ext -i
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version       1.1.7
platform      linux2 2.7.3 (default, Sep 26 2012, 21:53:58)
              [GCC 4.7.2]
--------------------------------------------------------------------
*** TKINTER support not available (Tcl/Tk 8.5 libraries needed)
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
--- LITTLECMS support available
--------------------------------------------------------------------
To add a missing option, make sure you have the required
library, and set the corresponding ROOT variable in the
setup.py script.

Test PIL

~$ python selftest.py
--------------------------------------------------------------------
PIL 1.1.7 TEST SUMMARY 
--------------------------------------------------------------------
Python modules loaded from ./PIL
Binary modules loaded from ./PIL
--------------------------------------------------------------------
--- PIL CORE support ok
*** TKINTER support not installed
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
--- FREETYPE2 support ok
--- LITTLECMS support ok
--------------------------------------------------------------------
Running selftest:
--- 57 tests passed.

Now Install PIL

~$ sudo python setup.py install
Software Solutions