PIL /JPEG Library: “decoder jpeg not available”

后端 未结 8 1185
醉酒成梦
醉酒成梦 2021-01-29 23:50

I tried to use PIL to do some JPEG work in my django app with PIL but I\'m getting this IOError.. not sure what to do.

\"\"decoder jpeg not available\"\"
         


        
相关标签:
8条回答
  • 2021-01-30 00:19

    You need to install jpeg library first and reinstall your PIL. For example, I'm using CentOS, to install libjpeg, I run

    sudo yum install -y libjpeg-devel
    

    It depends on what kind of linux you are using. And here you have to remove the old PIL

    rm -rf /usr/lib/python2.6/site-packages/PIL-1.1.7-py2.6-linux-x86_64.egg/
    

    Then install the PIL

    sudo easy_install PIL
    
    0 讨论(0)
  • 2021-01-30 00:20

    I don't have sudo privileges, because I am on a shared bluehost server. So I can't run any of those sudo apt-get jpeg commands. I ended up running

    pip uninstall pil
    pip install pillow
    

    and apparently pillow was able to find support for jpegs.

    0 讨论(0)
提交回复
热议问题