【发布时间】:2016-09-08 21:55:45
【问题描述】:
我正在尝试在 Jupyter 笔记本(Python 3.4)中使用 Pillow(版本 3.2.0)读取 jpg 文件,但它失败并出现以下错误:
OSError: 读取图像文件时数据流损坏
我正在使用以下代码:
from PIL import Image
im = Image.open("/path/to/image.jpeg")
im.show()
它在交互式 Python shell 和使用 Python 2.7 而不是 3.4 时都能正常工作。
我已经按照以下步骤操作:Using Pillow with Python 3
有人知道发生了什么吗?
【问题讨论】:
标签: python python-2.7 python-3.x pillow jupyter-notebook