PIL ioerror: decoder JPEG not available

Source: Internet
Author: User
Tags vps vps server
  1. # Ioerror: decoder JPEG not available
  2. # Fix:
  3. # First remove your last install!
  4. Rm-RF/usr/lib/python2.4/Site-packages/PIL
  5. Rm/usr/lib/python2.4/Site-packages/PIL. PTH
  6. Rm ~ /Imaging-1.1.6
  7. # Make sure you install at the libraries for both JPEG support and FreeType2:
  8. Yum install libjpeg
  9. Yum install libjpeg-devel
  10. Yum install FreeType
  11. Yum install FreeType-devel
  12. # Get Pil again and do the install:
  13. Wget http://effbot.org/media/downloads/Imaging-1.1.6.tar.gz
  14. Tar-zxvf Imaging-1.1.6.tar
  15. CD imaging-1.1.6/
  16. Python setup. py build_ext-I
  17. # Run the specified ded test to make sure everything now works:
  18. Python selftest. py
  19. # If everything worked do the real install:
  20. $ Python setup. py install

Recently I changed the website's VPs server, and the new vps uses the Debian 5.0 operating system. After some configuration, the website can be accessed normally after successful migration. However, an error occurred while uploading JPG images last night. You can view the program log and get the error log recorded by the upload program:

Ioerror: decoder JPEG not available

The error message indicates that this problem is related to the processing of JPG images, indicating that the python Pil library has a problem. PIL has been installed n times, and has been installed on Windows and Linux. This problem was first encountered. The reason for this problem was that Pil's jpgimage support component was not installed. Finally, the error is cleared through the following method. Save the photo and check it later.

Step 2: delete the installed Pil:

$ Rm-RF/usr/lib/python2.5/Site-packages/PIL

$ RM/usr/lib/python2.5/Site-packages/PIL. PTH

Step 2: Install the JPEG library and FreeType2 Library
(Errors always occur on Ubuntu. This step should be installed as follows:
 
sudo apt-get install libjpeg8-dev
)

$ Apt-Get install libjpeg-Dev

$ Apt-Get install libfreetype6-dev

Step 2: Compile PIL

We recommend that you delete the imaging folder and decompress a clean installer from the compressed package with tar.

$ CD image-1.1.6

$ Python setup. py build_ext-I

Step 2: Install

$ Python setup. py install

If no problem occurs, Pil can process JPG images normally. The above problem is located in the environment: debian5.0 + python2.5 + pil1.1.6.

[

pip uninstall PILsudo apt-get install libjpeg8-devsudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/libpip install PIL

]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.