mac安装python :
brew install python3
安装最后报错:
Installing python@3.10 dependency: gdbm
fatal: not in a git directory
Error: Command failed with exit 128: git
解决方案:
1.执行brew -v
Homebrew 3.6.14-45-g4fe0d08
fatal: detected dubious ownership in repository at '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'
To add an exception for this directory, call:
git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
Homebrew/homebrew-core (no Git repository)
fatal: detected dubious ownership in repository at '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask'
To add an exception for this directory, call:
git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask文章来源:https://www.toymoban.com/news/detail-441033.html
Homebrew/homebrew-cask (no Git repository)文章来源地址https://www.toymoban.com/news/detail-441033.html
2.根据提示执行这两行命令即可
3.继续执行 brew install python3 发现已可正常安装。
到了这里,关于mac 安装python 报错:gdbm fatal: not in a git directory的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!