1. 程式人生 > >ubuntu預設python版本切換(python2與python3)

ubuntu預設python版本切換(python2與python3)

電腦上面有些指令碼是python2的,有些是python3的,但是系統預設是python2,需要設定環境變數來進行切換.

python2切換到python3:

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

python3切換到python2:

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

檢視:

python