Search code examples
pythondjangopython-imaging-libraryredhatlibjpeg

PIL /JPEG Library: "decoder jpeg not available"


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""

Am I missing the JPEG decoder from my server? If so, how do I fix it?


Solution

  • 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