首页 > 代码库 > PIL 安装

PIL 安装

1.先安装依赖包,
ubuntu
apt-get install python-dev
apt
-get install libjpeg-devapt-get install libjpeg8-devapt-get install libpng3 apt-get install libfreetype6-devln -s /usr/lib/i386-linux-gnu/libfreetype.so /usr/libln -s /usr/lib/i386-linux-gnu/libjpeg.so /usr/libln -s /usr/lib/i386-linux-gnu/libz.so /usr/lib
redhat/centos
yum install python-devel libjpeg-turbo-devel libpng-devel freetype-devel

PIL还需要gcc编译器

2.最后使用pip安装PILpip install PIL --allow-unverified PIL --allow-all-external
安装完成后可以看到如下版本信息,可以看到PNG中支持JPEG/PNG/ZIP/FREETYPE2

PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform linux2 2.7.5 (default, Sep 15 2014, 17:30:20)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)]
--------------------------------------------------------------------
*** TKINTER support not available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
*** LITTLECMS support not available
--------------------------------------------------------------------

 

 

PIL 安装