当前位置: 首页 > 图灵资讯 > 行业资讯> python存储jpg图片出错解决方法

python存储jpg图片出错解决方法

发布时间:2025-12-11 16:48:21

Python的错误信息:

p1.jpg

解决方法:

安装pillow模块即可解决

pipinstallpillow

打开和显示图片

fromPILimportImage
img=Image.open('d:/dog.png')
img.show()

虽然使用Pillow,但它是由Pillow制成的 fork来了,所以import还是要从PIL进行的. 用open()函数打开图片,用show()函数显示图片。

更多Python知识,请关注:Python自学网!!

相关文章

python存储jpg图片出错解决方法

python存储jpg图片出错解决方法

2025-12-11
python代码检测工具及区别

python代码检测工具及区别

2025-12-11
python代码用什么看

python代码用什么看

2025-12-11
python导入dlib时出错解决方法

python导入dlib时出错解决方法

2025-12-11
python倒排列是什么意思

python倒排列是什么意思

2025-12-11
python的dtype可用对象有哪些?

python的dtype可用对象有哪些?

2025-12-11