问题描述 修改图片大小的时候,代码报错:AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS' 解决方案 在pillow的10.0.0版本中,ANTIALIAS方法被删除了。 方法1:修改版本(不推荐) pip install Pillow==9.5.0 方法2:修改代码 img = img.resize((216, 216), Image.ANTIALIAS) 修改为: img = img.resize((216, 216), Image.LANCZOS)