使用PIL在python中打开图像时无法调用'module'对象

问题描述

我想在python中打开图像。我一直在使用PIL打开图像,但它无法调用抛出'module'错误

import PIL
from PIL import Image

image=Image.open(r'C:\Users\intel\Downloads\11fcf12ff3cf97e8e7a88f3e485255e6.jpg')
print(image)

display(image)       #the error is thrown here

解决方法

确定要使用显示器吗?您想完成什么?也许显示... PIL库中有一个类似于show()的方法,因此在您的情况下为image.show()