(Linux/win) How do I install the pillow and Pil-pillow compatibility packs?

Source: Internet
Author: User
Tags image processing library

PIL (Python Imaging Library) is a common image processing library of Python, and pillow is a friendly fork of PIL, providing a wide range of file format support, powerful image processing capabilities, mainly including image storage, image display, Format conversion and basic image processing operations.

Pillow's Documentation: http://pillow.readthedocs.io/en/latest/

Pillow's Github:https://github.com/python-pillow/pillow

-----------------------------------------------------------------

Pillow Considerations for 0x0.

Pillow and PIL cannot co-exist in the same environment. Before installing Pillow, please uninstall PIL. Pillow >= 1.0 no longer supports "import Image". Please use the "from PIL import Image" instead. Pillow >= 2.1.0 no longer supports "import _imaging". Please use the From PIL. Image Import core as _imaging "instead. Pillow < 2.0.0 supports Python versions 2.4, 2.5, 2.6, 2.7.Pillow >= 2.0.0 < 4.0.0 supports Python versions 2.6, 2.7, 3.2, 3.3, 3.4, 3.5Pillow >= 4.0.0 supports Python versions 2.7, 3.3, 3.4, 3.5, 3.6

0x1. Windows installation PiL

PIL installation is troublesome, recommended download EXE direct installation

PIL Official website: http://pythonware.com/products/pil/

But now there is no access to the download link, I have 32-bit and 64-bit version uploaded to the blog park for download.

Pilwin32:http://files.cnblogs.com/files/pcat/pilwin32.zip

Pilwin64:http://files.cnblogs.com/files/pcat/pilwin64.zip

0x2. Windows installation Pillow

Install Pillow

or download the wheel file in http://www.lfd.uci.edu/~gohlke/pythonlibs/#pillow use PIP installation

0x3. Linux installation python2.7, pip

Install pythoninstall python-pip 

0x4. Linux Installation Pillow

Installing PIL in Linux is not recommended, it is more dependent, and there are various errors.

Kali Python has pillow installed by default.

Install Pillow in Debian/ubuntu:

Install python-imaging

Or

Install-i--no-cache-dir-v Pillow

Python-imaging Post-Installation support import Image

0x5. Pillow wrapper for PIL compatibility

GitHub Address: Https://github.com/yinpeng/pillow-pil

The author of the introduction: He also used pillow in the project to replace the PIL, but PiL and pillow import statement incompatibility caused the project code modification is good to say, the problem is later use of dependent PIL third-party components incompatible, we do not want to install pillow and PIL at the same time, And did not want to modify the source code of the third-party components, so he wrote a very simple pillow-pil, so that dependent on PIL third-party components can use pillow without modifying the source code. The installation is as follows:

Install Pillow-pil

0x6. PiL some errors

Importerror:the _imagingft C module is not installed

This is an error in installing PIL in Windows, it is recommended to install directly EXE.

PIL. Image.open () ioerror:cannot identify image file

First check whether the picture is correct, if a variety of checks or problems suggest reloading PIL

0x7. Pillow Report Keyerror Issues

Python>>>ImportImage>>>Image.init () 1>>>Image.SAVE.keys () [‘PCX‘,‘HDF5‘,‘Eps‘,‘Msp‘,‘XBM‘,‘WEBP‘,‘BUFR‘,‘Ppm‘,‘Bmp‘,‘Tga‘,‘ICO‘,‘Tiff‘,‘Jpeg‘,‘SPIDER‘,‘Gif‘,‘GRIB ",  ' im",  ' fits ",  ' pdf ",  "wmf",  ' mpo",  palm ", jpeg2000 ", " png"          

If the Image.SAVE.keys () output is empty, then the SAVE format key is not found, and when the image is generated it will be reported Keyerror, and the import image needs to be changed to the from PIL import image

(Linux/win) How do I install the pillow and Pil-pillow compatibility packs?

Related Article

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.