设置python版本:

1 sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100
2 sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150

切换python版本

1 sudo update-alternatives --config python

按照提示输入编号即可

 1 有 2 个候选项可用于替换 python (提供 /usr/bin/python)。
 2 
 3   选择       路径            优先级  状态
 4 ------------------------------------------------------------
 5 * 0            /usr/bin/python3   150       自动模式
 6   1            /usr/bin/python2   100       手动模式
 7   2            /usr/bin/python3   150       手动模式
 8 
 9 要维持当前值[*]请按<回车键>,或者键入选择的编号:0
10 bing@bing-Lenovo:~/download$ python
11 Python 3.6.7 (default, Oct 25 2018, 09:16:13) 
12 [GCC 5.4.0 20160609] on linux
13 Type "help", "copyright", "credits" or "license" for more information.
14 >>> exit()

这样你甚至可以将自己喜欢的任意版本python安装到任意位置,然后使用update-alternatives将其设置为系统默认python