PIL.Image class 找不到枕头
PIL.Image class not found with Pillow
我刚刚在 Windows 上用 pip3
安装了 Pillow(PIL 分支),我可以导入它,但是找不到 Image
class :
>>> import PIL
>>> PIL.Image
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'PIL' has no attribute 'Image'
我做错了什么?
在Pillow's documentation中找到了答案:
Warning
Pillow >= 1.0 no longer supports “import Image”. Please use
“from PIL import Image” instead.
from PIL import Image
有效。
我刚刚在 Windows 上用 pip3
安装了 Pillow(PIL 分支),我可以导入它,但是找不到 Image
class :
>>> import PIL
>>> PIL.Image
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'PIL' has no attribute 'Image'
我做错了什么?
在Pillow's documentation中找到了答案:
Warning
Pillow >= 1.0 no longer supports “import Image”. Please use “from PIL import Image” instead.
from PIL import Image
有效。