目的: 调用 PIL 中的 Image 的 fromarray 出现问题环境: PyCharm2020 和 python2.7 导入pillow6.2.2 出现的问题: 运行到 img = Image.fromarray(numpy_image, ‘RGB’) 报错: 'module' object has no attribute 'fromarray' 解决方案: 将导入 import PIL as Image 改为 from PIL import Image