转载:https://www.cnblogs.com/ccdc/p/4069112.html

1、安装

使用yum安装缺少类库:

#尤其重要,否则会报错
yum install python-devel

yum install libjpeg libjpeg-devel zlib zlib-devel freetype freetype-devel lcms lcms-devel
yum install python-imaging

测试:

#解压
tar xvfz Imaging-1.1.7.tar.gz    
python setup.py build_ext -i

如果报缺少类库则手动安装:

下载资源:

http://www.pythonware.com/products/pil/index.htm 下载最新版的PIL安装程序 tar xfz Imaging-1.1.7.tar.gz
http://www.ijg.org 下载jpeg库jpegsrc.v8b.tar.gz
http://www.gzip.org/zlib/ 下载zlib-1.2.5.tar.gz支持压缩功能的zlib库

#我安装9a失败,安装的8b
tar -zxf jpegsrc.v8b.tar.gz
cd jpeg-8b
./configure && make && make test && make install
 tar xfz zlib-1.2.5.tar.gz
 cd zlib-1.2.5
./configure && make && make install

修改配置后安装image

复制代码
#修改配置文件setup.py
TCL_ROOT = "/usr/lib/"    
JPEG_ROOT = "/usr/lib/"    
ZLIB_ROOT = "/usr/lib/"    
TIFF_ROOT = "/usr/lib/"    
FREETYPE_ROOT = "/usr/lib/"   
LCMS_ROOT = "/usr/lib/"

#安装
python setup.py install
复制代码

 

安装opencv2

pip install opencv-python

 

 

问题:

1、the imaging c module is not installed[5]

yum install python-imaging