This article mainly introduces how to solve the problem of installing Imaging in Python: The_imagingCmoduleisnotinstalled. it turns out that the library file of the PIL library is not added to the system, and this error is always prompted, for more information about how to use the PIL library to upload images by writing Python programs today, go to http://www.pythonware.com/products/pil/#pil117to download a 1.1.7. I use centos64 and install the PIL library in the Python version after upgrade.
First Download and unzip:
The 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
The 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.
The 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.
The 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