(base) whitewater@MadBookAir coding % brew install miniconda
==> Caveats
Please run the following to setup your shell:
conda init "$(basename "${SHELL}")"
Alternatively, manually add the following to your shell init:
eval "$(conda "shell.$(basename "${SHELL}")" hook)"
==> Downloading https://repo.anaconda.com/miniconda/Miniconda3-py312_24.7.1-0-MacOSX-arm64.sh
Already downloaded: /Users/whitewater/Library/Caches/Homebrew/downloads/57374f3916fa2e3ee4e1bc31461692e4f2a54ac4d1306ae3b6f1a8b04f51d2d1--Miniconda3-py312_24.7.1-0-MacOSX-arm64.sh
==> Installing Cask miniconda
==> Purging files for version py312_24.7.1-0 of Cask miniconda
Error: Permission denied @ dir_s_mkdir - /opt/homebrew/Caskroom/miniconda/py312_24.7.1-0
似乎是以前把brew装到子账号了,所以管理员账号没有权限创建文件夹/opt/homebrew/Caskroom/miniconda/py312_24.7.1-0
解决办法很简单
sudo chown -R $(whoami) /opt/homebrew/Caskroom/miniconda
然后继续brew install miniconda
即可