python “decoder JPEG not available PIL”

By admin at 2013-12-10 01:44:51 • 1102次点击

一个在vps 上使用PIL 出现错误的解决方法

On Ubuntu:

# install libjpeg-dev with apt
sudo apt-get install libjpeg-dev

# reinstall PIL
pip install -I PIL
If that doesn't work, try one of the below, depending on whether you are on 64bit or 32bit Ubuntu (thanks Charles Offenbacher for pointing out this differs for 32bit).

For Ubuntu x64:

sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib
sudo ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib
sudo ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib
Or for Ubuntu 32bit:

sudo ln -s /usr/lib/i386-linux-gnu/libz.so /usr/lib/
sudo ln -s /usr/lib/i386-linux-gnu/libfreetype.so.6 /usr/lib/
sudo ln -s /usr/lib/i386-linux-gnu/libjpeg.so /usr/lib/
Then reinstall PIL:

pip install -I PIL

http://stackoverflow.com/questions/8915296/python-image-library-fails-with-message-decoder-jpeg-not-available-pil 1

python, decoder, jpeg, not, available, pil


登录 后发表评论