【发布时间】:2021-09-27 00:54:43
【问题描述】:
当我运行以下命令时
from tkinter import *
from PIL import ImageTk, Image
root.mainloop()
我明白了
Traceback (most recent call last):
File "image_viewer.py", line 2, in <module>
from PIL import ImageTk, Image
ImportError: No module named PIL
但我已经安装了 Pillow,一切都很好。
【问题讨论】:
-
如果“一切正常”,你现在有什么问题
-
可能你的电脑上安装了不同版本的 Python 并且安装了错误的 Pillow。
-
这能回答你的问题吗? How to install PIL with pip on Mac OS?
-
如果您使用的是 PyCharm,那么您必须通过 PyCharm 应用程序安装模块。此外,它可能是一个版本的东西。尝试
pip3 install Pillow并查看jetbrains.com/help/pycharm/…
标签: python python-imaging-library