ubuntu16.04中默认已经安装了python2.7和python3.
开始,
跳到系统目录 并检测版本
cd /usr
cd /bin
/usr/bin$ ls |grep python
dh_python2 dh_python3 python python2 python2.7 python2.7-config python2-config python3 python3.5 python3.5m python3m python-config x86_64-linux-gnu-python2.7-config x86_64-linux-gnu-python-config
/usr/bin$ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
$sudo update-alternatives –install /usr/bin/python python /usr/bin/python2 100
$ sudo update-alternatives –install /usr/bin/python python /usr/bin/python3 150
以后可以进行切换了
核心命令
sudo update-alternatives – -config python