1、安装PIL所需的系统库

$ yum install zlib zlib-devel
$ yum install libjpeg libjpeg-level
$ yum install freetype freetype-devel

2、删除Python下安装的PIL

rm -rf /usr/lib/python2.7/site-packages/PIL
rm /usr/lib/python2.7/site-packages/PIL.pth
#或者
rm -rf /usr/lib/python2.7/dist-packages/PIL
rm /usr/lib/python2.7/dist-packages/PIL.pth
#如果/usr/local/python2.7/dist-packages/PIL存在最好也全部删除

3、下载安装PIL

$ wget http://effbot.org/media/downloads/Imaging-1.1.7.tar.gz
$ tar -zxvf Imaging-1.1.7
$ cd Imaging-1.1.7
$ python setup.py build_ext -i  #用来进行安装前的检查
$ #修改setup.py
TCL_ROOT = "/usr/lib64/"
JPEG_ROOT = "/usr/lib64/"
ZLIB_ROOT = "/usr/lib64/"
TIFF_ROOT = "/usr/lib64/"
FREETYPE_ROOT = "/usr/lib64/"
LCMS_ROOT = "/usr/lib64/"
$ #安装
$ python setup.py install

GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:2 个月前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐