换了新工作之后,闲暇之余想多了解Python的知识和使用,因为mac自带的Python版本为2.x, 为了更新至Python3,于是安装了Homebrew。
Homebrew是一款Mac OS平台下的软件包管理工具,拥有安装、卸载、更新、查看、搜索等很多实用的功能。首先我们先用终端查询一下当前Mac自带的Python版本,输入 python --version 即可,如下图:

按理来说安装Homebrew很简单,只要打开终端输入
/usr/bin/ruby -e"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
即可,但是苦等了几分钟后我却安装失败了。报默认值太小的错误。

百度一下,说是因为curl的postBuffer默认值太小的原因,重新在终端配置一下这个值就可以了。解决方法:git config –global http.postBuffer 524288000
注:524288000代表B,524288000B也就是500MB。
我翻了一下百度出来的答案好像都是这个结果,于是就试了一下,后来还是错了。

然后我就打开倚天剑 Google一下,搜索出来的结果和度娘的还是有很大差距的:

谷歌出来的说是pods版本低才导致报默认值大小的错误,于是就更新了一下pods:

之后又重新安装Homebrew,安装成功~~【此时很想吐槽从度娘那里搜索出的答案】

再接着安装Python新版本:

安装完毕并检查一下是否为最新版本:

Success!
网友评论