1、安装Zlib
去Zlib官网看一下最新的版本是哪个,我用的是
cd ~
wget http://zlib.net/zlib-1.2.11.tar.gz
tar -xvzf zlib-1.2.11.tar.gz
cd zlib-1.2.11/
./configure --prefix=/usr/local
make
sudo make install
2、安装libpng
可以去ftp://ftp.simplesystems.org/pub/libpng/png/src看一下最新版本是哪个
cd ~
wget ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng16/libpng-1.6.29.tar.gz
tar -xvzf libpng-1.6.29.tar.gz
cd libpng-1.6.29/
./configure --prefix=/usr/local
make
sudo make install
3、安装freetype
cd ~
wget https://jaist.dl.sourceforge.net/project/freetype/freetype2/2.7.1/freetype-2.7.1.tar.gz
tar -xvzf freetype-2.7.1.tar.gz
cd freetype-2.7.1/
./configure --prefix=/usr/local
make
make install
4、安装libjpeg
cd ~
wget http://www.ijg.org/files/jpegsrc.v9b.tar.gz
tar -xvzf jpegsrc.v9b.tar.gz
cd jpeg-9b/
./configure --prefix=/usr/local
make
sudo make install
5、安装devel库
sudo apt-get install libjpeg9-dev
sudo apt-get install libpng12-dev
sudo apt-get install libfreetype6-dev
sudo apt-get install zlib1g-dev
6、安装PIL
cd ~
$ wget http://effbot.org/downloads/Imaging-1.1.7.tar.gz
$ tar -xvzf Imaging-1.1.7.tar.gz
$ cd Imaging-1.1.7/
修改setup.py文件
nano setup.py
修改如下:
JPEG_ROOT = "/usr/local/lib"
ZLIB_ROOT = "/usr/local/lib"
FREETYPE_ROOT = "/usr/local/lib"
安装:
python setup.py build
sudo python setup.py install