PIL遇到问题解决

时间:2022-05-06
本文章向大家介绍PIL遇到问题解决,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

PIL 全称:Pillow

在使用PIL4.2.1版本读取jpeg文件时,报cannot identify image file,去github源查找原因:https://github.com/python-pillow/Pillow/issues/2628 ,感觉坑比较大,所以回避了这个版本

重新卸载掉Pillow 

sudo pip uninstall Pillow

重新下载,由于使用官方的镜像太慢,也规避掉并指定3.3.1版本,采用国内豆瓣的源:

pip install Pillow=3.3.1 -i https://pypi.douban.com/simple

这样问题解决.