brew 中切换软件版本

written in brew, python

brew 中切换软件版本

我有更新软件的习惯,习惯性的每天更新一下。比如brew ,pip3等。

这不,前天把brew 就把python 3.6.5 升级到了python 3.7了,这个是大升级,结果python库都没有了,当然可以另行安装,也很方便,反正有写了批量更新的脚本,但没有到还有兼容性的问题。

网上找一堆办法,有的命令已经过期了 brew versions,有的太复杂,看不明白。 后来还是找到了一个办法,提前是老版本python没有删除。

brew info python3

python: stable 3.7.0 (bottled), HEAD
Interpreted, interactive, object-oriented programming language
https://www.python.org/
/usr/local/Cellar/python/3.6.5 (4,900 files, 102.3MB)
  Poured from bottle on 2018-04-03 at 09:54:11
/usr/local/Cellar/python/3.6.5_1 (4,869 files, 101.5MB) *
  Poured from bottle on 2018-06-25 at 09:02:25
/usr/local/Cellar/python/3.7.0 (4,976 files, 104.2MB)
  Poured from bottle on 2018-07-02 at 08:50:46
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/python.rb

上面显示了brew系统已经安装的pytho3的版本,有3个版本,其它有两个3.6.5,我也不知道原因。

brew swithc python 3.6.5_1 ``` $brew switch python3 3.6.5_1 Cleaning /usr/local/Cellar/python/3.6.5 Cleaning /usr/local/Cellar/python/3.6.5_1 Cleaning /usr/local/Cellar/python/3.7.0 25 links created for /usr/local/Cellar/python/3.6.5_1 ````

再试试,就可以用回3.6.5 了