首页 > 系统 > Linux > 正文

Linux系统安装Python PIL模块

2024-06-28 16:00:15
字体:
来源:转载
供稿:网友

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/PILrm /usr/lib/python2.7/site-packages/PIL.pth#或者rm -rf /usr/lib/python2.7/dist-packages/PILrm /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.pyTCL_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


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表