当我运行以下内容时:
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,一切都很好。
pip3 install Pillow
,并查看https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html#packages-tool-window - Thomas