Installing the Python Image Library (Pillow)

Source: Internet
Author: User

Kkninjae Source: Http://www.cnblogs.com/kkninjae reprint Please indicate the source, thank you.

Recently read an image grayscale algorithm article, intends to use Python to implement the algorithm mentioned in the article.

So find a bit of Python processing picture multimedia files Library, found that Python's own library Imageop in Python3 inside was discarded, decisive throw (although I use the Python2:)).

Then found the Python Image Library,api, straightforward enough. But this library has not been updated for a long time, decisive throw. Fortunately found its Fork version, just changed a name Pillow.

I do not like to install a bunch of software and tools in the machine, so I always follow the practice of few but good. Widows platform has been using Cygwin for development, have to spit groove, widows to uphold this practice to do development is really painful.

Install the corresponding library

1 Install libjpeg-devel libjpeg8 zlib-devel zlib02install libtiff-devel libtiff4 libfreetype-devel libfreetype63install liblcms2-devel liblcms2_2 libwebp-devel LIBWEBP4install tcl tcltk python-tkinter libopenjpeg-devel libopenjpeg1 openjpeg

Under the Cygwin platform I use APT-CYG to manage the software, so that you do not have to run the setup every time you install the software, you can directly install the required software in the command line just like in Ubuntu. I made an alias setting for Apt-cyg's command, so what I see here is apt-get.

Question One

The problem comes when you run to the fourth command, reporting the error as shown:

The error that is given in the prompt is that Xlib.h this header file does not exist, try to install the X11 problem has been resolved.

1 Install xorg-x11-base xorg-x11-devel

Once the libraries are installed, you can install Pillow.

1 Install Pillow

Question Two

Run the Setup command again and jump out of the error as shown:

You can see that this is a fork run error, and the Python library finds that the fork function of Python itself has problems under the Cygwin platform. Also gives the solution to the Rebaseall. It's easy to find what to do with Google. The solution mentioned even rebase, in the process of the back of the problem is still possible to reproduce, have to say Cygwin is pain, the actual situation is so, I rebase several times.

Basically, Pillow should be able to install it smoothly.

Installing the Python Image Library (Pillow)

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.