How to install PIL in Ubuntu 11.04?

前端 未结 4 1805
死守一世寂寞
死守一世寂寞 2021-02-14 16:27

I see this question asked all over the internet, and I\'ve tried following them all, but I still can\'t get PIL to work.

I tried symbolically linking the zlib, jpeg, et

4条回答
  •  佛祖请我去吃肉
    2021-02-14 17:10

    I have successfully reinstalled PIL in Ubuntu 12.04 like this:

    pip uninstall PIL
    apt-get install libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev
    ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib/
    ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/
    ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/
    pip install -U PIL
    

    It does not raise the IOError: decoder zip not available anymore after reinstalling the PIL. My error traceback was:

    Traceback (most recent call last):
      File "convert_image.py", line 15, in 
        image.save('output.png')
      File "/usr/local/lib/python2.7/dist-packages/PIL/Image.py", line 1406, in save
        self.load()
      File "/usr/local/lib/python2.7/dist-packages/PIL/ImageFile.py", line 189, in load
        d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
      File "/usr/local/lib/python2.7/dist-packages/PIL/Image.py", line 385, in _getdecoder
        raise IOError("decoder %s not available" % decoder_name)
    IOError: decoder zip not available
    

提交回复
热议问题