PIL in Ubuntu 14.04

With pillow Replacing PIL it has no more been much Widely Used.

Still if in any cases you want to install PIL then here goes the tutorial if you failed trying installing pip via

pip install PIL

http://www.pythonware.com/products/pil/
python setup.py install

First make sure you have following libraries

sudo apt-get build-dep python-imaging
sudo apt-get install libjpeg62 libjpeg62-dev

And try there installing via pip install PIL.

if it continues to fail, it can be due to PIL searching those libraries in a different path.

It turns out that the APT installations put the libraries under /usr/lib/x86_64-linux-gnu and PIL will search for them in /usr/lib/. So you have to create symlinks for PIL to see them.

Try to see if libjpeg and libz libs exist in /usr/lib/x86_64-linux-gnu and make a symlink this way

32-bit version

sudo ln -s /usr/lib/i386-linux-gnu/libz.so /usr/lib/libz.so
sudo ln -s /usr/lib/i386-linux-gnu/libjpeg.so /usr/lib/libjpeg.so
sudo ln -s /usr/lib/i386-linux-gnu/libfreetype.so /usr/lib/libfreetype.so

64-bit version

sudo ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/libz.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/libjpeg.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib/libfreetype.so

转:
http://www.knolworld.com/pil-in-ubuntu-14-04/

==============================================================

备注:在原文的基础上,删除了原文中(粗体+下划线)的操作.

其它参考:
http://askubuntu.com/questions/156484/how-do-i-install-python-imaging-library-pil

posted @ 2014-12-11 10:07  kylinfish  阅读(811)  评论(0)    收藏  举报