【问题标题】:Error: No similarly named formulae found. Error: No available formula or cask with the name "python"错误:未找到类似名称的公式。错误:没有可用的公式或名称为“python”的木桶
【发布时间】:2021-05-08 00:11:27
【问题描述】:

所以,我正在使用 macOS Big Sur。于是我输入:

python--版本

Python 2.7.16

brew 安装 python

当我想通过终端更新我的 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.

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

【问题讨论】:

  • 您的系统可能仍然依赖于使用 python2 的进程。如果您想安装多个 python,虚拟环境管理器非常适合此任务。最好不要修改你系统安装的python
  • @francescowang - 你试过从Python website下载并安装Python3吗?

标签: python python-3.x python-2.7 visual-studio-code terminal


【解决方案1】:

在终端运行这个命令:

rm -fr $(brew --repo homebrew/core)

那就试试吧:

 brew install python3

它将安装 python 3.9。

【讨论】:

  • 这适用于在遇到此错误时安装任何东西。
【解决方案2】:

这对我有用。使用确切的版本,例如 python@3.9

首先使用搜索可用的包

brew search python

然后安装你想要的版本:

brew install python@3.9

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-11-03
    • 2022-01-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-02
    • 2018-09-14
    相关资源
    最近更新 更多