要在Linux上從Python 2升級到Python 3,請按照以下步驟操作:
python --version
python2 --version
這將顯示已安裝的Python 2和Python 3的版本(如果有)。
sudo apt-get update
sudo apt-get install python3
sudo apt-get install python3-pip
sudo apt-get remove python python2
python3 --version
pip3 install example_package
現在,您已經成功地將Linux系統中的Python從2升級到了3。