p0lar_bear
p0lar_bear

Reputation: 2265

Pillow 2.0 refuses to work with zlib

I've taken so many approaches to trying to get this to work, my head is spinning.

I have Pillow installed on my Lubuntu 13.04 (Raring Ringtail) with Python 3.3.1. Any time I try to open a PNG image, it raises AttributeError: 'module' object has no attribute 'zip_decoder' followed by OSError: decoder zip not available. I've manually compiled zlib and it lives in /usr/local/zlib/lib/libz.so. There's a soft link at /usr/lib/libz.so pointing to it as well. I also have the zlib1g package installed through Synaptic.

I've tried installing Pillow through all of the following methods:

On my attempts with pip3 and manual compiles, I get this output:

--------------------------------------------------------------------
SETUP SUMMARY (Pillow 2.0.0 fork, originally based on PIL 1.1.7)
--------------------------------------------------------------------
version      2.0.0 (Pillow)
platform     linux 3.3.1 (default, Apr 17 2013, 22:30:32)
             [GCC 4.7.3]
--------------------------------------------------------------------
*** TKINTER support not available
--- JPEG support available
*** ZLIB (PNG/ZIP) support not available
*** TIFF G3/G4 (experimental) support not available
*** FREETYPE2 support not available
*** LITTLECMS support not available
*** WEBP support not available
--------------------------------------------------------------------

On manual installs, I go into setup.py and give ZLIB_ROOT a value of '/usr/local/zlib/lib'

Yet after all of this, Pillow just absolutely refuses to acknowledge the fact that zlib exists on my machine, and compiles without ZIP support.

What am I missing?

Upvotes: 1

Views: 1070

Answers (1)

Ronald Oussoren
Ronald Oussoren

Reputation: 2810

Have you tried installing the "-devel" packages for zlib (and libjpeg, ... if you want to have support for JPEG and other file formats)? The devel packages contain the C headers that are needed to compile C code (such as the Pillow extension) that uses the libraries.

Upvotes: 2

Related Questions