找不到Python 3.6的Tkinter模块

2024-03-29 14:00:27 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用的是python3.6。我试图用sudo apt-get install python3-tk安装tkinter。结果是:

> Reading package lists... Done Building dependency tree        Reading
> state information... Done python3-tk is already the newest version
> (3.6.8-1~18.04).

但是在python3中,当我尝试用import tkinterfrom tkinter import *导入它时,它给了我一个错误,说没有名为_tkinter的模块。我怎么解决这个问题?在

注意:在Python2中它似乎工作得很好,因为import Tkinter没有给出任何错误,但是这个错误发生在Python3中


Tags: installimportpackagegettkinter错误sudoapt