目录

ubuntu-Python2与Python3切换

ubuntu Python2与Python3切换

在ubuntu上刚开始默认的是Python2,要想从Python2切换到Python3,进行如下配置即可:

1 Python2切换到Python3

echo alias python=python3 >> ~/.bashrc
source ~/.bashrc

2 Python3切换到Python2

gedit  ~/.bashrc
alias python=python3 
source ~/.bashrc

3 查看版本

python -V