美文网首页
Mac使用Homebrew安装python3.6.5时出错

Mac使用Homebrew安装python3.6.5时出错

作者: 9ae313d036e9 | 来源:发表于2018-04-28 13:00 被阅读609次

在mac的命令行工具上使用Homebrew安装Python3.6.5

>$ brew install python3

结果出现如下的错误:

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 install python3
Warning: python 3.6.5 is already installed, it's just not linked
You can use `brew link python` to link this version.

这时,Python3.6.5已经安装了,但是没有链接到,并提示使用‘brew link python’链接:

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

然后百度一下,发现好多解决的链接,选个逼格高点的:
https://github.com/Homebrew/homebrew-core/issues/19286

按照里面的方法:

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

接下来链接python

>$ brew link python
Linking /usr/local/Cellar/python/3.6.5... 1004 symlinks created

运行python3

>$ python3
Python 3.6.5 (default, Apr 25 2018, 14:23:58) 
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

OK ,解决!!!

相关文章

网友评论

      本文标题:Mac使用Homebrew安装python3.6.5时出错

      本文链接:https://www.haomeiwen.com/subject/fzhglftx.html