- # Ioerror: decoder JPEG not available
- # Fix:
- # First remove your last install!
- Rm-RF/usr/lib/python2.4/Site-packages/PIL
- Rm/usr/lib/python2.4/Site-packages/PIL. PTH
- Rm ~ /Imaging-1.1.6
- # Make sure you install at the libraries for both JPEG support and FreeType2:
- Yum install libjpeg
- Yum install libjpeg-devel
- Yum install FreeType
- Yum install FreeType-devel
- # Get Pil again and do the install:
- Wget http://effbot.org/media/downloads/Imaging-1.1.6.tar.gz
- Tar-zxvf Imaging-1.1.6.tar
- CD imaging-1.1.6/
- Python setup. py build_ext-I
- # Run the specified ded test to make sure everything now works:
- Python selftest. py
- # If everything worked do the real install:
- $ 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
]