轉載:https://www.cnblogs.com/ccdc/p/4069112.htmlhtml
一、安裝python
使用yum安裝缺乏類庫:測試
#尤爲重要,不然會報錯 yum install python-devel yum install libjpeg libjpeg-devel zlib zlib-devel freetype freetype-devel lcms lcms-devel
yum install python-imaging
測試:ui
#解壓 tar xvfz Imaging-1.1.7.tar.gz python setup.py build_ext -i
若是報缺乏類庫則手動安裝:spa
下載資源:code
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庫htm
#我安裝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
修改配置後安裝imageblog
#修改配置文件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
安裝opencv2ip
pip install opencv-python
問題:資源
一、the imaging c module is not installed[5]
yum install python-imaging