Linux / Python · 2012-04-17

解决linode(ubuntu)下pil报decoder jpeg not available错误

解决linode(ubuntu)下pil报decoder jpeg not available错误

sudo rm -rf /usr/local/lib/python2.7/site-packages/PIL/
sudo rm -rf /usr/local/lib/python2.7/site-packages/PIL.pth
sudo rm -rf ~/Imaging-1.1.7

sudo aptitude install libjpeg libjpeg-dev
sudo aptitude install libfreetype6 libfreetype6-dev

wget http://nick.txtcc.com/nickfiles/Imaging-1.1.7.tar.gz
tar -xzvf Imaging-1.1.7.tar.gz
cd Imaging-1.1.7
sudo python setup.py build_ext -i

运行以下测试程序,如果测试通过即可编译安装PIL
python selftest.py

sudo python setup.py install
安装完成即可。

如果还是不行,切记要删除源码目录后再重新解压编译安装,必然解决问题!