Python Install Image Module command detailed

Source: Internet
Author: User
Tags image processing library

The recent project uses Python to process the output file, need to use the image module to deal with the picture, the default installed Python is not with the image Library, installation PiL Image Library is very simple, share the ~

If JPEG and zlib support is required first install the appropriate package

First, download the source package Download the latest version of PIL installer, I downloaded the tar xfz imaging-1.1.7.tar.gz

Http:// The latest version is jpegsrc.v8b.tar.gz, install the JPEG library zlib-1.2.5.tar.gz zlib library with compression enabled

Use the Python image processing library pil (Python image libraries) to convert the type of picture, modify the picture size, color value, transparency, and so on. There is also a special feature that can combine 2 pictures into 1 pictures. Specific features can refer to PiL's official documentation

The latest version is jpegsrc.v9.tar.gz, install the JPEG library

The code is as follows Copy Code

TAR-ZXF jpegsrc.v9.tar.gz
./configure && make && make test && make install


Download the zlib-1.2.8.tar.gz zlib library that supports compression, install Zlib

The code is as follows Copy Code
Tar Xfz zlib-1.2.8.tar.gz
CD zlib-1.2.8
./configure && make && make install

Now is the installation of Imagemok, download first: in download imaging-1.1.7.tar.gz

The code is as follows Copy Code
Tar Xfz imaging-1.1.7.tar.gz
CD Imaging-1.1.7
Python build_ext-i
Python bulid
sudo python install

This completes the installation, and the next step is to test:

Run Python, and then "import Image", if there is no error should be OK

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: 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.