【问题标题】:Python Tkinter on Windows? [duplicate]Windows 上的 Python Tkinter? [复制]
【发布时间】:2020-01-29 22:37:57
【问题描述】:

我刚刚在 Windows 10 上全新安装了 Python。我输入“python”并获得 Python 3.7.4。我尝试导入 Tkinter,它说“没有名为 'Tkinter' 的模块。我在网上看了一圈,都说 Tkinter 是 Python 附带的标准库。任何帮助将不胜感激。

【问题讨论】:

    标签: python windows tkinter


    【解决方案1】:

    从 python 3 开始,Tkinter 模块被重命名为tkinter。 尝试改用import tkinter

    Tkinter 在 Python 3 中已重命名为 tkinter。2to3 工具将在将您的源代码转换为 Python 3 时自动调整导入。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-25
      • 1970-01-01
      • 1970-01-01
      • 2023-03-09
      • 2017-03-22
      • 2018-05-26
      相关资源
      最近更新 更多