# brew安装miniconda时报错Permission denied @ dir\_s\_mkdir - /opt/homebrew/Caskroom/miniconda/

**URL:** <https://forum.beginner.center/t/topic/1472>\
**Category:** 🛠工具与编程\
**Tags:** conda, homebrew\
**Created:** [2024 年9 月 28 日 12:59 UTC](https://forum.beginner.center/t/topic/1472 "2024-09-28T12:59:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

作者： ![doggie](https://forum.beginner.center/user_avatar/forum.beginner.center/doggie/32/550_2.png) [@doggie](https://forum.beginner.center/u/doggie)\
发布日期： [2024 年9 月 28 日 12:59 UTC](https://forum.beginner.center/t/topic/1472/1 "2024-09-28T12:59:27Z")

</div>

```auto
(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

解决办法很简单

```auto
sudo chown -R $(whoami) /opt/homebrew/Caskroom/miniconda

```

然后继续`brew install miniconda`即可
