相关疑难解决方法(0)

在Python中导入Tkinter时的ImportError

我正在尝试使用带有标准库Tkinter的Python 3.2测试GUI代码,但我无法导入库.

这是我的测试代码:

from Tkinter import *

root = Tk()
w = Label(root, text="Hello, world!")
w.pack()
root.mainloop()
Run Code Online (Sandbox Code Playgroud)

shell报告此错误:

Traceback (most recent call last):
File "<pyshell#9>", line 1, in <module>
from Tkinter import *
ImportError: No module named Tkinter
Run Code Online (Sandbox Code Playgroud)

python tkinter

19
推荐指数
3
解决办法
8万
查看次数

标签 统计

python ×1

tkinter ×1