Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

About the PIL Error -- IOError: decoder zip not available

I am getting the:

IOError: decoder zip not available 

when I try to draw an image and save to a jpeg in PIL. Any thoughts on how to resolve this? PIL has worked fine for me in the past, when it comes to viewing/uploading images.

like image 474
DevX Avatar asked Aug 23 '10 01:08

DevX


2 Answers

sudo pip uninstall PIL sudo pip install pillow  

^^ fixed it for me.

Pillow is a fork of PIL that is compatible with pip/setuptools and gets a little better maintenance. I haven't seen any API differences yet.

Edit: There is one notable API difference. PIL exposes Image as a top-level namespace, so you can

import Image # in PIL only 

but

from PIL import Image  # in pillow or PIL 
  • Thanks, Leopd!
like image 110
Cory Avatar answered Oct 04 '22 23:10

Cory


The more detail installation PIL with zlib library in Ubuntu 64 bit :

http://obroll.com/install-python-pil-python-image-library-on-ubuntu-11-10-oneiric/

For the lazy (credits to @meawoppl for the apt-get):

$ sudo apt-get install libjpeg-dev zlib1g-dev 
like image 23
yodi Avatar answered Oct 04 '22 23:10

yodi