Install Python's PiL library under Windows7

Source: Internet
Author: User

Objective:

The most commonly used image processing library in Python is the PIL (pythonimaging Library), where the image class is a very important class in the PIL library, where instances can be loaded directly into the image file. The three methods of reading the processed image and getting the image through the fetching method.

One PIL version selection

From the online search, PIL official only 32-bit installation files, the installation will be prompted to find the Python installation path. The reason why the PIL library cannot be installed under 64-bit Win7 is that the PIL binary installation package provided by PIL official http://www.pythonware.com/products/pil/is 32-bit. The location of the 64-bit program and the 32-bit program to detect the registry is not the same: 64-bit programs detect Hkey_local_machinesoftwarepython, and 32-bit programs detect HKEY_LOCAL_ Machinesoftwarewow6432nodepython. If the python installed is 64-bit, the information is below Hkey_local_machinesoftwarepython, while the 32-bit program is HKEY_LOCAL_ Machinesoftwarewow6432nodepython below to find the Python installation information, results can not be found, so will hold the wrong.

There are unofficial 64-bit libraries on the Internet (official source code compiled), called Pillow. Pillow is an alternative version of PIL. Its website is: http://www.lfd.uci.edu/~gohlke/pythonlibs/.

There are 6 versions on this website, namely PILLOW-3.1.0-CP27-NONE-WIN32.WHL, PILLOW-3.1.0-CP27-NONE-WIN_AMD64.WHL, PILLOW-3.1.0-CP34-NONE-WIN32.WHL, PILLOW-3.1.0-CP34-NONE-WIN_AMD64.WHL, PILLOW-3.1.0-CP35-NONE-WIN32.WHL and PILLOW-3.1.0-CP35-NONE-WIN_AMD64.WHL.

According to my current situation, I downloaded the PILLOW-3.1.0-CP27-NONE-WIN32.WHL. This file is not an executable file and is described on the website and needs to be installed using the PIP tool.

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

PIL (Python Imaging library) is a powerful and convenient image processing library for Python, and its fame is relatively large. However, only Python 2.7 is supported.

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

Pillow is a derived branch of PIL, but has now evolved into a more dynamic image processing library than PIL itself. Currently the latest version is 3.0.0.

Pillow's GitHub homepage: https://github.com/python-pillow/Pillow
Pillow documentation (corresponding to version v3.0.0): https://pillow.readthedocs.org/en/latest/handbook/index.html
Pillow document Chinese Translation (corresponding to version v2.4.0): http://pillow-cn.readthedocs.org/en/latest/

Python 3.x Installation Pillow

Installing pillow for Python is simple, using PIP or Easy_install as long as a single line of code.

Use PIP installation at the command line:
Pip Install Pillow

or use Easy_install installation at the command line:
Easy_install Pillow

When the installation is complete, use the From PIL import image to reference the library

Install Python's PiL library under Windows7

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.