I am trying to get the sample heatmap.py running from: http://jjguy.com/heatmap/
#image.py
import heatmap
import random
if __name__ == \"__main__\":
This worked Perfectly for me:
apt-get install libjpeg62 libjpeg62-dev zlib1g-dev libfreetype6 libfreetype6-dev
In x86_64:
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
In i386:
ln -s /usr/lib/i386-linux-gnu/libz.so /usr/lib/
ln -s /usr/lib/i386-linux-gnu/libfreetype.so.6 /usr/lib/
ln -s /usr/lib/i386-linux-gnu/libjpeg.so /usr/lib/
pip install -U PIL --allow-external PIL --allow-unverified PIL
pip install -I pillow
Even though my PIL was up to date, I resolved this on Ubuntu 12.04 with:
pip uninstall PIL
pip install PIL
even you test with
from PIL import image
is okay, but there is still error on save/decode methods.
you can try my steps: (base on my case, openerp 7 with ubuntu 13.10)
check it http://febru.soluvas.com/2014/03/solved-openerp-7-ioerror-decoder-zip.html
I just encountered a similar issue caused by having both PIL (installed through the python pip installer) and the python-imaging package installed via apt-get. When I removed the extra version from pip that resolved it for me.
If you installed PIL from source or using pip then you might have the same problem.
When I was building PIL I also discovered that I had to link over the libraries to /usr/lib. That might resolve the not supported messages in your log above.
sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib
sudo ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib
sudo ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib
I remember arriving at the exact same solution as Kris did when installing PIL on 64 bit systems.
However nowadays I would recommend using Pillow (pip install pillow) instead of PIL. Pillow is simply a fork of PIL with more frequent releases and less issues like the one you're experiencing.
If you're on Ubuntu I think you need zlib1g-dev and libjpeg-dev installed before installing PIL/Pillow so that you get support for jpeg/png built in.