【问题标题】:Tkinter in python - not foundpython中的Tkinter - 未找到
【发布时间】:2018-04-27 11:06:41
【问题描述】:

我想在 python 2.7 中使用 tkinter,但它说找不到。我也不能使用 pip install 安装它。怎么安装?

Python 2.7.5 (default, Nov  6 2016, 00:28:07)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> import tkinter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named tkinter

>>> import Tkinter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named Tkinter
>>>



pip install tkinter
Collecting tkinter
  Could not find a version that satisfies the requirement tkinter (from versions: )
No matching distribution found for tkinter


 pip install Tkinter
Collecting Tkinter
  Could not find a version that satisfies the requirement Tkinter (from versions: )
No matching distribution found for Tkinter

【问题讨论】:

  • 您是否收到有关您的 pip 版本的任何警告?
  • 你不能用 pip 安装 tkinter

标签: python python-2.7 tkinter


【解决方案1】:

您需要安装python-tk 包:

apt install python-tk

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-10-02
    • 2020-11-02
    • 2016-01-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多