【发布时间】:2020-07-28 23:06:21
【问题描述】:
由于其他原因,我不得不卸载并重新安装 python。 现在我通过 pyenv 下载了 python 3.8.2 但正在运行:
import tkinter
我得到的错误是:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/cagava/.pyenv/versions/3.8.2/lib/python3.8/tkinter/__init__.py", line 36, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'
为什么会这样?我在 python 安装中缺少一些模块吗?
请注意,我在 Mac 上工作
我已经尝试了针对该问题 (Python not configured for Tk) 提出的解决方案,其他人提出了相同的方法,但它并没有解决我的问题
【问题讨论】:
-
为什么会这样? ----->
import _tkinter # If this fails your Python may not be configured for Tk -
我在这个网站上发现了 11 个带有确切错误消息的问题。他们都没有帮助你吗?
-
不,很遗憾我找不到解决问题的方法,我已经研究了一段时间了?
-
使用来自 www.python.org/downloads 的正确安装程序安装 Python
标签: python macos tkinter installation-package