首先到Python官網(wǎng)跷跪,點(diǎn)擊Download Python 3.7.0
按鈕馋嗜。
進(jìn)入到這個(gè)頁(yè)面够吩,點(diǎn)擊下載對(duì)應(yīng)mac的版本糙置。下載成功后直接根據(jù)提示按鈕
安裝完成瑰煎,打開(kāi)終端執(zhí)行下面命令:
// 移除python2
sudo mv /usr/bin/python /usr/bin/python2
=> Password (讓你輸入你mac的密碼)
// 查看python3安裝路徑
which python3
=> /usr/local/bin/python3
// 建立軟鏈接
sudo ln -s /usr/local/bin/python3 /usr/bin/python
python
=> Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)
=> [Clang 6.0 (clang-600.0.57)] on darwin
=> Type "help", "copyright", "credits" or "license" for more information.
=> >>>
就這么簡(jiǎn)單折砸,python2.7升級(jí)到python3.7大功告成烦周!