from PIL import Image
print(Image.__version__)
输出为7.0.0版本
img_path = "D:\\pythonProject\\Python_Opencv\\cat.jpg"
img = Image.open(img_path)
运行出现报错:UserWarning: image file could not be identified because WEBP support not install
经过查询是当前pillow版本太低了,所以需要更新pillow
解决方法:
pip install --upgrade pillow --user
重启jupyter,再次执行相关代码,就成功运行了