1.先安装依赖包,ubuntu
apt-get install python-devapt-get install libjpeg-dev apt-get install libjpeg8-dev apt-get install libpng3 apt-get install libfreetype6-dev ln -s /usr/lib/i386-linux-gnu/libfreetype.so /usr/lib ln -s /usr/lib/i386-linux-gnu/libjpeg.so /usr/lib ln -s /usr/lib/i386-linux-gnu/libz.so /usr/lib
redhat/centosyum install python-devel libjpeg-turbo-devel libpng-devel freetype-devel
PIL还需要gcc编译器
2.最后使用pip安装PIL
pip 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
--------------------------------------------------------------------
时间: 2024-10-06 04:01:16