我尝试使用PIL打开照片,但无法打开。
如何完成?
这是我的代码和错误消息:
from PIL import Image
img = Image.open('test.png')
File "imagetest.py", line 3, in <module>
img = Image.open('test.png')
File "/anaconda3/lib/python3.7/site-packages/PIL/Image.py", line 2687, in open
% (filename if filename else fp))
OSError: cannot identify image file 'test.png'