admin管理员组

文章数量:1654264

python PIL库image.open()报错cannot identify image file ‘1.jpg’/WEBP

1.导入库时使用import Image

更改为from PIL import Image

2.pillow版本问题

pip install pillow更新至最新版

3.anconda特有问题

运行时会有一条警告:UserWarning: image file could not be identified because WEBP support not installed
WEBP支持未被安装,数据源头为WEBP格式即使你后缀为jpg仍会被以WEBP数据无法识别这是anconda独有的问题,在其它python编辑器中我还不曾见到
解决办法为更换运行所用的python编辑器或更改图片格式(直接更改后缀无法解决该问题)

4.文件本身有问题

本文标签: 报错ImageOpenPythonPIL