首页 > 解决方案 > 我已经安装了枕头,但无法将其导入 python shell

问题描述

我查看了 30 多个不同的页面,但找不到我需要的答案。我使用的是 Windows 10,我使用的是 python 3.9.0。所以我像这样安装了 Pillow 8.1.0:

python3 -m pip install --upgrade Pillow

然后尝试使用以下命令将枕头导入外壳:

import PIL
import Pillow
import pillow
from Pillow import Image
from PIL import Image
from PIL import *
from Pillow import *

但我ModuleNotFoundError每次都得到。

你有另一种将枕头放入蟒壳的方法吗?

感谢您提前回答。

标签: python-imaging-librarypython-importwindows-10-desktoppython-3.9

解决方案


使用 Pillow 8.1.0 的 python 3.9 及更高版本,使用 from pil import Image。


推荐阅读