This error occurs when the 'save' method is called on the 'PIL.Image' module, which is not defined.

To fix this error, make sure you are calling the 'save' method on an instance of the 'Image' class imported from the 'PIL' module, like this:

from PIL import Image

img = Image.open('image.jpg')
img.save('new_image.jpg')

This should save the image in the specified format with the specified name.

python AttributeError: module 'PIL.Image' has no attribute 'save'

原文地址: http://www.cveoy.top/t/topic/w9E 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录