安装pyenv时出现Homebrew错误

3

我最近通过终端安装了Homebrew,但是当我试图使用它来安装其他程序时,出现了一些错误。

这是我尝试安装pyenv时的一个示例情况。

brew install pyenv

这是上述命令的输出结果:
Running `brew update --preinstall`...
Warning: No available formula with the name "ca-certificates".
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
Error: 
  homebrew-cask is a shallow clone.
To `brew update`, first run:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
This command may take a few minutes to run due to the large size of the repository.
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!
Error: pyenv: undefined method `cellar' for #<BottleSpecification:0x00007fd7720b4360>

1
你尝试按照错误提示所说的去做了吗? - glennsl
1个回答

12

我遇到了完全相同的问题。

在macOS Monterey 12.1上解决我的问题的方法是通过brew doctor来调查问题,然后执行输出所建议的操作。

brew doctor的输出告诉我,homebrew/homebrew-core没有被正确地安装,并推荐执行以下命令:

rm -rf "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core"
brew tap homebrew/core

然后我只需按照Pyenv的安装过程继续操作,一切都正常工作了。


1
请使用以下命令:rm -rf $(brew --repo homebrew/core) - StXh

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接