作为一个小白,Python3的第一个练手项目是写一个爬虫,需要处理验证码,所以用了Pillow模块。
程序写好后,在本地的Windows上用得好好的,但移植到云服务器 (centos)却出了问题,先是提示libjpeg和libpng相关库不存在,搜索网上的教程安装后,在python的命令行输入:from PIL import Image,却又抛出错误:
libjpeg.so.8: cannot open shared object file: No such file or directory
libjpeg.so.8
to your /etc/ld.so.conf
file, and then run ldconfig
include /usr/local/lib
export LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib' >> ~/.bashrc