Error in Image Library (PIL) "decoder JPEG not available"

Asked 1 years ago, Updated 1 years ago, 80 views

On my computer, PIL supports JPEG This error appears when you upload a file. How do I solve this?

File "PIL/Image.py", line 375, in _getdecoder
    raise IOError("decoder %s not available" % decoder_name)
IOError: decoder jpeg not available

python jpeg python-imaging-library pillow

2022-09-22 22:27

1 Answers

libjpeg-dev seems to have a problem processing the jpeg file through pillow (or PIL) In this case, you will need to reinstall pilot/PIL.

To reinstall/reinstall the pillow, remove the existing pillow pip uninstall PIL (or pillow)

I will explain based on Ubuntu environment.

If the method of 1 does not work, follow the architecture and reinstall the pillow

from 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

from 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/


2022-09-22 22:27

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.