您好,登錄后才能下訂單哦!
小編給大家分享一下如何把Ubuntu16和18上的python升級(jí)到最新python3.8,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!
本文記錄在 Ubuntu 16.04 上將 python 升級(jí)為 3.8 版本,并配置為系統(tǒng)默認(rèn) python3 的過(guò)程。
在 Ubuntu 16.04 中,python3 的默認(rèn)版本為 3.5:
$ python3 -V
Python 3.5.2
本文以在 Ubuntu 16.04 中安裝為例,方法同樣適用于 Ubuntu 18.04 。
Ubuntu 官方 apt 庫(kù)中還未收錄 python 3.8,這里使用 deadsnakes PPA 庫(kù)安裝。
$ sudo apt update $ sudo apt install software-properties-common
$ sudo add-apt-repository ppa:deadsnakes/ppa
Press [ENTER] to continue or Ctrl-c to cancel adding it.
$ sudo apt install python3.8
$ python3.8 -V
Python 3.8.2
$ which python3.8 /usr/bin/python3.8 $ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1 $ which python3.5 /usr/bin/python3.5 $ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 2
$ sudo update-alternatives --config python3 There are 2 choices for the alternative python3 (providing /usr/bin/python3). Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/bin/python3.5 2 auto mode 1 /usr/bin/python3.5 2 manual mode 2 /usr/bin/python3.8 1 manual mode Press <enter> to keep the current choice[*], or type selection number: 2
選擇/輸入 2, 回車。
$ python3 -V
Python 3.8.2
資源
How to Install Python 3.8 on Ubuntu 18.04
How to upgrade to python 3.7 on Ubuntu 18.10
以上是“如何把Ubuntu16和18上的python升級(jí)到最新python3.8”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。