On the internet to find a lot of methods are still not, also unclear, began to think is PIL the installation of this library has a problem, but even if the correct installation of PIL still will appear the above error. The reason is that the decoder decoder problem.
Later found a bag called Imaging-1.1.7, randomly installed a bit, the result is not heeded. Technical debt is always to pay, just did not think so soon, near the project release and on Ubuntu encountered the same kind of problem,
Use this package directly, but the result is ...
The answer is, of course, painful, or IOError.
Well, the painful thing to let it pass, after some of the toss after the last discovery of a glimmer of light, please note the following table information:
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
Version 1.1.7
Platform linux2 2.7.6 (default, June 22 2015, 17:58:13)
[GCC 4.8.2]
--------------------------------------------------------------------
TKINTER Support Not available
JPEG Support Not available
ZLIB (Png/zip) support not available
FREETYPE2 Support Not available
LITTLECMS Support Not available
--------------------------------------------------------------------
Computer Qanda.ren Programming
Note: This table is displayed in the Imaging installation directory with the Python setup.py build command.
If you look at it in detail, you'll find it, right! All image decoding is not supported. The problem is not on the PIL, but on the decoder. I was able to poop on OSX before. Installation success must have been installed before these decoder.
In order to let other friends will not fall into this pit, specifically the installation method to tidy up a bit:
Mac OSX
Brew Update
Brew Install Libjpeg libpng
It's enough for both of them.
Ubuntu 14.0.4
sudo apt-get install Libjpeg-dev libpng12-dev libfreetype6-dev Libtiff-dev
Linux is a bit more miserable, to install a few more packages.
This is not enough, it is best to use Pillow this Python package instead of manually download Imaging this package, directly with the following instructions
Pip Install-i--no-cache-dir-v Pillow
This command will be completed with a lot of information, regardless of it, just find the following:
--------------------------------------------------------------------
PIL SETUP SUMMARY
--------------------------------------------------------------------
Version Pillow 3.2.0
Platform linux2 2.7.6 (default, June 22 2015, 17:58:13)
[GCC 4.8.2]
--------------------------------------------------------------------
TKINTER Support Not available
---JPEG support available
Openjpeg (JPEG2000) support not available
---ZLIB (png/zip) support available
LIBTIFF Support Not available
---FREETYPE2 support available
LITTLECMS2 Support Not available
WEBP Support Not available
Webpmux Support Not available
--------------------------------------------------------------------
To add a missing option, make sure you have the required
Library, and set the corresponding ROOT variable in the
setup.py script.
To check the build, run the selftest.py script.
Computer programming PiL the installation of this library is problematic