Login or register    
Website screenshot service | LinkPeek.com

Ubuntu Python easy_install PIL does not install zlib or png support

I was getting the following error even though the zlib dev libraries were already installed correctly.

--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version       1.1.7
platform      linux2 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53)
              [GCC 4.5.2]
--------------------------------------------------------------------
*** TKINTER support not available
*** JPEG support not available
*** ZLIB (PNG/ZIP) support not available
*** FREETYPE2 support not available
*** LITTLECMS support not available
--------------------------------------------------------------------
To add a missing option, make sure you have the required
library, and set the corresponding ROOT variable in the
setup.py script.

Apparently PIL setup.py doesn't know how to find libz.so.

PIL expects libz.so to be located in /usr/lib not /usr/lib/i386-linux-gnu/libz.so

I fixed this issue by building a link to were PIL setup.py looks and where the library really exists!

How to fix

  1. Find the location of your systems libz.so
find . -name libz.so
  1. Create a soft link from libz.so to /usr/lib

    Ubuntu 32bit:

    sudo ln -s /usr/lib/i386-linux-gnu/libz.so /usr/lib
    

    Ubuntu 64bit:

    sudo ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib
    

Notes

You might need to delete the PIL egg from your pythons site-packages directory and attempt to re-install the package

ubuntu

sudo apt-get build-dep python-imaging

Comments

Leave a comment

Please login or register to leave a comment!