ModuleNotFoundError:python 3.8.0 mac OS 10.15.3上没有名为“\u tkinter”的模块

2024-09-27 17:38:09 发布

您现在位置:Python中文网/ 问答频道 /正文

在Mac OS 10.15.3(Catalina)和pyenv上使用Python 3.8.0

当我尝试运行文件时,它会返回:

ModuleNotFoundError: No module named '_tkinter'

我试过了。我有点担心,因为我在pyenv之上运行python,任何第三方tkinter模块都无法正常运行

运行brew doctor返回:

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
  `/Users/jm/.pyenv/shims/python3.7-config
  /Users/jm/.pyenv/shims/python3.7m-config
  /Users/jm/.pyenv/shims/python-config
  /Users/jm/.pyenv/shims/python3-config
  /Users/jm/.pyenv/shims/python3.8-config`

Tags: 文件theconfigpyenvostkintermacscripts
3条回答

尝试使用pip3它在我的pip3安装tk中工作

您应该安装tkinter。要在控制台上安装tkinter,请编写以下命令:

pip install tk

在尝试了一系列事情之后,它最终是这样工作的:

$ brew install python-tk

相关问题 更多 >

    热门问题