When installing Imaging in Python, The following error occurs: The _ imaging C module is not installed. imaging_imaging

Source: Internet
Author: User

When installing Imaging in Python, The following error occurs: The _ imaging C module is not installed. imaging_imaging

The PIL library is required to write a Python program to upload images today. So I downloaded 1.1.7from http://www.pythonware.com/products/pil/?pil117. I used centos64 and installed the PIL library in the Python version after upgrade.
First download and unzip:
Copy codeThe Code is as follows:
[Root @ lee ~] # Wget http://www.pythonware.com/products/pil/#pil117
[Root @ lee ~] # Tar-xf Imaging-1.1.7.tar.gz

Then prepare for Installation
Copy codeThe Code is as follows:
[Root @ lee ~] # Cd image-1.1.7
[Root @ lee Imaging-1.1.7] # python setup. py build_ext-I

No problem. During The test and installation, The system always prompts: *** The _ imaging C module is not installed.
Copy codeThe Code is as follows:
[Root @ lee Imaging-1.1.7] # python selftest. py
* ** The _ imaging C module is not installed

After searching for a long time, I couldn't find out why. Later, I found the key to the problem from a bunch of English files on the official website. The solution is to set the path based on my own python PIL path.
Copy codeThe Code is as follows:
[Root @ lee Imaging-1.1.7] # echo '/usr/local/lib/python2.7/site-packages/PIL'>/etc/ld. so. conf
[Root @ lee Imaging-1.1.7] # ldconfig

Re-install python selftest. py


Python 33 PIL: The _ imaging C module is not installed?

First, check whether you have the _ imaging module.
Check whether _ imaging is available on windows. pyd file (in some cases _ imaging. dll), and my directory is C: \ Python27 \ Lib \ site-packages \ PIL. Find _ imaging in Unix. so or _ imagingmodule. so
File, Some Unix platforms may have a. sl extension.
Use the following method to check the directory:
Open the command prompt, enter python-v, and then enter import Image
Another method is import sys, and print sys. path

Finally, if this is the case, enter import _ imaging in interactive mode and prompt
Then check whether the installed PIL matches your computer, 32-bit or 64-bit. Reinstall

In python image processing, the following error occurs at the beginning. How can this problem be solved?

Reinstall PIL

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.