错误:未找到类似命名的公式。错误:没有名称为“python”的可用公式或木桶

fra*_*ang 4 python terminal python-2.7 python-3.x visual-studio-code

所以,我使用的是 macOS Big Sur。所以我输入:

蟒蛇--版本

蟒蛇 2.7.16

酿造安装蟒蛇

当我想通过我的终端更新我的 python 时,我收到了这个错误消息。

Error: No similarly named formulae found.
Error: No available formula or cask with the name "python".
It was migrated from homebrew/cask to homebrew/core.
Run Code Online (Sandbox Code Playgroud)

我想将它更新到 Python 3,所以当我在 VSC 上运行我的命令时。我可以只输入 python 而不是 python3。这个错误信息是什么意思?

小智 10

在终端中运行此命令:

rm -fr $(brew --repo homebrew/core)
Run Code Online (Sandbox Code Playgroud)

然后尝试:

 brew install python3
Run Code Online (Sandbox Code Playgroud)

它将安装python 3.9。

  • 这适用于在遇到此错误时安装任何东西。 (2认同)