教你實(shí)現(xiàn)Ubuntu安裝Python
配置環(huán)境
Ubuntu安裝Python的方式與其他Linux系統(tǒng)有所不同,在這里介紹一下。
切換的國內(nèi)源:
sudo gedit /etc/apt/sources.list
將原有的源注釋掉,添加如下內(nèi)容:
#清華源 deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
更新apt-get:
sudo apt-get update
安裝build-essential:
sudo apt-get install build-essential
安裝Python
安裝Python3.8:
sudo apt-get install python3.8 sudo apt install python3-pip
查看是否成功:
查看Python是否安裝成功:
python3 --version
輸出版本號Python 3.8.5即表示安裝成功。
Ubuntu更換源
臨時更換
使用阿里源:
pip install *** -i https://mirrors.aliyun.com/pypi/simple/
永久更換
新建.pip隱藏文件夾:
cd ~ mkdir .pip
新建pip.conf文件:
cd .pip touch pip.conf
用vim編輯pip.conf文件
vim pip.conf
內(nèi)容如下:
[global] index-url = https://mirrors.aliyun.com/pypi/simple [install] trusted-host=mirrors.aliyun.com
以上就是教你實(shí)現(xiàn)Ubuntu安裝Python的詳細(xì)內(nèi)容,更多關(guān)于Ubuntu安裝Python的資料請關(guān)注腳本之家其它相關(guān)文章!
相關(guān)文章
Python實(shí)現(xiàn)ping指定IP的示例
今天小編就為大家分享一篇Python實(shí)現(xiàn)ping指定IP的示例,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-06-06
python動態(tài)視頻下載器的實(shí)現(xiàn)方法
這里向大家分享一下python爬蟲的一些應(yīng)用,主要是用爬蟲配合簡單的GUI界面實(shí)現(xiàn)視頻,音樂和小說的下載器。今天就先介紹如何實(shí)現(xiàn)一個動態(tài)視頻下載器,需要的朋友可以參考下2019-09-09
基于Keras 循環(huán)訓(xùn)練模型跑數(shù)據(jù)時內(nèi)存泄漏的解決方式
這篇文章主要介紹了基于Keras 循環(huán)訓(xùn)練模型跑數(shù)據(jù)時內(nèi)存泄漏的解決方式,具有很好的參考價值,希望對大家有所幫助。一起跟隨想過來看看吧2020-06-06
Python數(shù)據(jù)擬合實(shí)現(xiàn)最小二乘法示例解析
這篇文章主要為大家介紹了Python數(shù)據(jù)擬合實(shí)現(xiàn)最小二乘法的示例解析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步2021-10-10

