Python解释器:ModuleNotFoundError:没有名为“ _tkinter”的模块

时间:2020-01-13 17:36:03

标签: python python-3.x tkinter

运行import tkinter时出现此错误:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/tkinter/__init__.py", line 37, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'

破坏apt-get install python3-tk不会解决这个问题。

在Debian实验版上运行Python 3.9

1 个答案:

答案 0 :(得分:-1)

也许您可以尝试使用import tkinter而不是import _tkinter