【发布时间】:2020-05-25 09:35:54
【问题描述】:
在带有 pyenv 的 Mac OS 10.15.3 (Catalina) 上使用 Python 3.8.0。
当我尝试运行一个文件时,它返回:
ModuleNotFoundError: No module named '_tkinter'
我试过brew install tcl-tk。我有点担心,因为我在 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`
【问题讨论】:
-
brew doctor和brew upgrade python3命令显示什么? -
如果配置脚本覆盖了系统或 Homebrew 提供的同名脚本,则路径中的其他脚本可能会混淆通过 Homebrew 安装的软件。我们发现了以下“配置”脚本:
/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和brew upgrade python3返回了Warning: python3 3.7.6_1 already installed -
尝试删除
python3.7配置。看到这个issue。 -
它会影响我的 pyenv 设置吗?