Ubuntu下安裝卸載python3.8的過程
一、Python 3.8 安裝
在 Ubuntu 16.04 中,python3 的默認(rèn)版本為 3.5:
$ python3 -V Python 3.5.2
本文以在 Ubuntu 16.04 中安裝為例,方法同樣適用于 Ubuntu 18.04 。
1.通過 Apt 安裝Python3.8
Ubuntu 官方 apt 庫(kù)中還未收錄 python 3.8,這里使用 deadsnakes PPA 庫(kù)安裝。
1.1. 安裝依賴包
$ sudo apt-get update $ sudo apt-get install software-properties-common
1.2. 添加 deadsnakes PPA 源
$ sudo add-apt-repository ppa:deadsnakes/ppa Press [ENTER] to continue or Ctrl-c to cancel adding it.
1.3. 安裝 python 3.8
$ sudo apt-get update $ sudo apt-get install python3.8 $ python3.8 -V Python 3.8.2
2.配置 python3.8 為系統(tǒng)默認(rèn) python3
修改默認(rèn) python3 會(huì)導(dǎo)致打不開 Terminal 等各種問題,建議不要修改。解決方法見 Ubuntu16.04TLS 中終端(Terminal)無法打開的解決辦法
2.1. 將 python 各版本添加到 update-alternatives
$ 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
2.2. 配置 python3 默認(rèn)指向 python3.8
$ 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, 回車。
2.3 測(cè)試 python 版本
$ python3 -V Python 3.8.2
二、卸載python3.8
1、卸載python3.8
sudo apt-get remove python3.8
2、卸載python3.8及其依賴
sudo apt-get remove --auto-remove python3.8
3、清除python3.8
sudo apt-get purge python3.8 or sudo apt-get purge --auto-remove python3.8
注釋:
此方法卸載python比較徹底,所以適合更換python版本時(shí)使用。
——對(duì)于既想完全卸載python,又無法接受完全卸載后某些python組件無法使用的童鞋,請(qǐng)慎重!
參考鏈接:
[1] 如何將 Ubuntu 16 和 18 上的 python 升級(jí)到最新 3.8 版
到此這篇關(guān)于Ubuntu下python3.8的安裝與卸載的文章就介紹到這了,更多相關(guān)Ubuntu python3.8安裝卸載內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
對(duì)python 通過ssh訪問數(shù)據(jù)庫(kù)的實(shí)例詳解
今天小編就為大家分享一篇對(duì)python 通過ssh訪問數(shù)據(jù)庫(kù)的實(shí)例詳解,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2019-02-02
關(guān)于vscode?默認(rèn)添加python項(xiàng)目的源目錄路徑到執(zhí)行環(huán)境的問題
這篇文章主要介紹了vscode?默認(rèn)添加python項(xiàng)目的源目錄路徑到執(zhí)行環(huán)境,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2022-02-02
Python接口自動(dòng)化系列之unittest結(jié)合ddt的使用教程詳解
這篇文章主要介紹了Python接口自動(dòng)化系列之unittest結(jié)合ddt的使用教程詳解,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2021-02-02
Python使用Apache Kafka時(shí)Poll拉取速度慢的解決方法
在使用Apache Kafka時(shí),poll方法拉取消息速度慢常見于網(wǎng)絡(luò)延遲、消息大小過大、消費(fèi)者配置不當(dāng)或高負(fù)載情況,本文提供了優(yōu)化消費(fèi)者配置、并行消費(fèi)、優(yōu)化消息處理邏輯和監(jiān)控調(diào)試的解決方案,并附有Python代碼示例和相關(guān)類圖、序列圖以幫助理解和實(shí)現(xiàn)2024-09-09
完美解決python遍歷刪除字典里值為空的元素報(bào)錯(cuò)問題
下面小編就為大家?guī)硪黄昝澜鉀Qpython遍歷刪除字典里值為空的元素報(bào)錯(cuò)問題。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2016-09-09
Python3 webservice接口測(cè)試代碼詳解
這篇文章主要介紹了Python3 webservice接口測(cè)試代碼詳解,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2020-06-06
python將dict中的unicode打印成中文實(shí)例
這篇文章主要介紹了python將dict中的unicode打印成中文實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2020-05-05
selenium+python自動(dòng)化測(cè)試之鼠標(biāo)和鍵盤事件
這篇文章主要介紹了selenium+python自動(dòng)化測(cè)試之鼠標(biāo)和鍵盤事件,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2019-01-01

