“IOError: decoder zip not available” : Ubuntu Python PIL

前端 未结 5 1253
予麋鹿
予麋鹿 2020-12-17 19:09

I am trying to get the sample heatmap.py running from: http://jjguy.com/heatmap/

#image.py
import heatmap
import random

if __name__ == \"__main__\":    
            


        
5条回答
  •  遥遥无期
    2020-12-17 19:38

    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
    

提交回复
热议问题