首先我們需要打開命令行窗口。
輸入python,一般默認是打開python2。
輸入python3,才會打開python3。
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100
我們設置一下python2為默認。
同樣的方法,設置python3為默認。
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150
sudo update-alternatives --config python
因為我們已經標記好了。所以這個指令可以切換任意一個版本為默認版本。
END