Python Image Library fails with message “decoder JPEG not available” – PIL ?

Python Image Library fails with message “decoder JPEG not available” – PIL ?

Asked on November 9, 2018 in Python.
Add Comment


  • 3 Answer(s)

       libjpeg-dev is needed to be able to method jpegs with pillow (or PIL), therefore you wish to put in it then recompile pillow. It conjointly looks that libjpeg8-dev is required on Ubuntu fourteen.04

       If you are still victimisation PIL then you must very be victimisation pillow currently tho’, therefore initial pip uninstall PIL before following these directions to modify, or if you have got a decent reason for projecting with PIL then replace “pillow” with “PIL” within the below).

    On Ubuntu:

    # install libjpeg-dev with apt
    sudo apt-get install libjpeg-dev
    # if you're on Ubuntu 14.04, also install this
    sudo apt-get install libjpeg8-dev
    # reinstall pillow
    pip install --no-cache-dir -I pillow
    

    If above code is not work,try one of below code depands on title.

    For Ubuntu x64:

    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
    

    Or for

    Ubuntu 32bit:

    sudo ln -s /usr/lib/i386-linux-gnu/libjpeg.so /usr/lib/
    sudo ln -s /usr/lib/i386-linux-gnu/libfreetype.so.6 /usr/lib/
    sudo ln -s /usr/lib/i386-linux-gnu/libz.so /usr/lib/
    

    Then reinstall pillow:

    pip install --no-cache-dir -I pillow
    
    Answered on November 9, 2018.
    Add Comment

       This is the sole means that worked on behalf of me. putting in packages and reinstalling PIL did not work.
       On ubuntu, install the desired package:

    sudo apt-get install libjpeg-dev
    

    Then replace PIL with pillow:

    pip uninstall PIL
    pip install pillow
    
    Answered on November 9, 2018.
    Add Comment

       Use this code to works on ubuntu 12.04:

    pip uninstall PIL
    apt-get install libjpeg-dev
    apt-get install libfreetype6-dev
    apt-get install zlib1g-dev
    apt-get install libpng12-dev
    pip install PIL --upgrade
    

       when it show “— JPEG support available” that means it works.

    Answered on November 9, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.