Ubuntu安装Python

原文链接
ubuntu安装python的方式与其他linux系统有所不同,在这里介绍一下。
配置环境切换的国内源:
sudo gedit /etc/apt/sources.list将原有的源注释掉,添加如下内容:
#清华源deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiversedeb 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.8sudo 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 .piptouch pip.conf用vim编辑pip.conf文件
vim pip.conf内容如下:
[global]index-url = https://mirrors.aliyun.com/pypi/simple[install]trusted-host=mirrors.aliyun.comtrusted-host=mirrors.aliyun.comtrusted-host=mirrors.aliyun.com
学习更多编程知识,请关注我的公众号:
代码的路


坚果Pro2S评测 不再冷淡多了一丝妖娆
今年能在E3上看到多少VR游戏?
在PCB设计中DDR布线的原则与重要性
华为余承东对外公开表示:华为和奔驰展开合作
2020顺德(深圳)芯片产业链资本对接会成功举办
Ubuntu安装Python
AI助力野生动物保护行动 或将扭转物种数量持续减少的恶性趋势
通过MQTT在LoRaWAN网络中获取LoRa节点数据
如何利用单片机实现LED点阵横向动画移动
保力新“押注”锂电低速智能出行市场
本源物联发布纯国产5G工业路由器
关于换气可变性在轿车柴油机上的潜力分析介绍
比特币里的“元宇宙”是什么?
关于电磁兼容返回路径的疑惑
QCraft率先使用NVIDIA DRIVE Orin方案
便携式水中生物毒性检测仪是什么
铝基板快速打样知识点总结
云栖大会展出超算力超续航新品  个人计算终端呈现云端加速融合
大幅面打印机的供纸方式/纸张容量
OPPO是第一波采用OLED面板的业者 高端手机坟场需求开始浮出