小编Bry*_*anB的帖子

如何在 macOsSierra 上使用 tkinter 模块

我正在尝试学习如何在 Python 中使用 tkinter 模块,但是当我在本地运行它时,我收到以下错误:

Traceback (most recent call last):
  File "emailer", line 1, in <module>
    from tkinter import messagebox
ImportError: No module named tkinter
Run Code Online (Sandbox Code Playgroud)

我试过了pip install tkintersudo pip install tkinter这会引发以下错误:

Could not find a version that satisfies the requirement tkinter (from versions: )
No matching distribution found for tkinter
Run Code Online (Sandbox Code Playgroud)

最后which python在终端中运行时,输出是/usr/bin/python

python macos tkinter

4
推荐指数
1
解决办法
8633
查看次数

标签 统计

macos ×1

python ×1

tkinter ×1