admin avatar

python “decoder JPEG not available PIL”

🕡 by admin

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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

💘 相关文章

写一条评论

Based on Golang + fastHTTP + sdb | go1.17.1 Processed in 0ms