首页 > 解决方案 > 我安装了 Pillow 并尝试使用 from PIL import Image 但它给出了错误

问题描述

我已经安装了 Pillow (7.2.0) 但是当我使用

from PIL import ImageTk, Image, ImageDraw, ImageFont

它给了我这个错误:ModuleNotFoundError: No module named 'PIL'

我能做些什么?我做到了pip install Pillow。我试过卸载和安装枕头,但没有用。我在 Windows 上并且有 python 3.7

标签: pythonimportpippython-imaging-library

解决方案


使用以下命令获取最新版本的 Pillow

pip install wheel
pip install Pillow

我已经在 Google Colab 中完成了 在此处输入图像描述


推荐阅读