2017-04-15 77 views
1
发现

我只是pip3安装枕头(PIL层叉)在Windows上,我可以进口,但Image类不能被找到:PIL.Image类不能与枕头

>>> import PIL 
>>> PIL.Image 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
AttributeError: module 'PIL' has no attribute 'Image' 

我做了什么错?

回答

3

找到答案在Pillow's documentation

警告

枕头> = 1.0不再支持“进口图像”。请使用 “从PIL导入图像”代替。

from PIL import Image工作。

+0

这是很多人遇到的常见错误 –