4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[mac]brew install python3 実行時に brewがコケて死んだ時の対処法

Last updated at Posted at 2019-04-06

$ brew install python3 でpython3をインストールしようとしただけなのに、
brewがコケて死んだ時の対処法。

調べればすぐに出てきますが、一応こういうこともあるんだなー程度にめも。

以下のようなエラーで死にます。

Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied @ dir_s_mkdir - /usr/local/Frameworks
Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks

brew link ステップでコケたのも権限が足りないのもわかる。で、どうするんだと…
下記リンクを参考にして対処しました!

やることとしては以下の通り

##1. $ brew doctor

$ brew doctorと打つだけで解決策を表示してくれるらしい!簡単!

$ brew doctor
...
You should create these directories and change their ownership to your account.
  sudo mkdir -p /usr/local/sbin
  sudo chown -R $(whoami) /usr/local/sbin
...

ん?エラーで出てたディレクトリと違う…?けどまあ実行。

2. シンボリックリンクを再作成!

$ brew link python
Linking /usr/local/Cellar/python/3.7.3... Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks

エラー!
もしかしてさっきの関係なかった?

こっちも作成する

$ sudo mkdir -p /usr/local/Frameworks
$ sudo chown -R $(whoami) /usr/local/Frameworks

再度チャレンジ

$ brew link python
Linking /usr/local/Cellar/python/3.7.3... 1 symlinks created

できた!

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?