NameError: name ‘ImageDraw‘ is not defined

ImageDraw 模块是 Pillow 库的一部分,因此您需要导入它才能使用它。
为此,请在程序顶部添加这行代码:

from PIL import ImageDraw

你可能感兴趣的:(python)