Ubuntu16.04系统中一般是有两种python版本的,分别是python2和python3
查看python2的版本
python2 --version
查看python3的版本
python3 --version
查看系统默认指向的版本
python --version
我操作的结果:
![](https://img.laitimes.com/img/9ZDMuAjOiMmIsIjOiQnIsIyZuBnLwMDO4IDO1AjMzETOwkTMwIzLc52YucWbp5GZzNmLn9Gbi1yZtl2Lc9CX6MHc0RHaiojIsJye.png)
将系统默认指向的版本改为python3
echo alias python=python3 >> ~/.bashrc
source ~/.bashrc
我操作的结果:
Ubuntu16.04系统中一般是有两种python版本的,分别是python2和python3
python2 --version
python3 --version
python --version
我操作的结果:
echo alias python=python3 >> ~/.bashrc
source ~/.bashrc
我操作的结果: