PIL ImageTK 是 Raspberry PI

PIL ImageTK on Raspberry PI

我试图在 Raspberry Pi 上为 Python3 安装 ImageTk:

sudo apt-get install python3-pil
sudo apt-get install python3-imaging-tk

和:

E: Unable to locate package python3-pil
E: Unable to locate package python3-imaging-tk

我在网上搜索但没有。有什么问题?我该如何解决?

注意:我已经更新了apt-get

我发现了问题,我已经安装了 PIL,但是他已经过时了并且不起作用,当我尝试安装 pillow 时,python 使用的是 PIL,而不是 Pillow。为了解决,我删除了 PIL 和 Pillow 并执行:pip install pillow

如果你有同样的问题,你必须卸载PIL和Pillow并重新安装Pillow。这很好用。