brew link python:Permission denied @ dir_s_mkdir

在用brew doctor执行的时候提示:
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run brew link on these:
于是执行

brew link python

然后报错:
Linking /usr/local/Cellar/python/3.7.2_2… Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks

查了半天才知道是/usr/local/Frameworks是这个文件没有创建,这种提示能不能更友好,于是先创建文件,然后再赋权限:

sudo mkdir /usr/local/Frameworks

sudo chown $(whoami):admin /usr/local/Frameworks

然后执行:

brew link python

后提示:
Linking /usr/local/Cellar/python/3.7.2_2… 1 symlinks created

证明执行成功!
 

你可能感兴趣的:(Mac)