安装python3.10 基于ubuntu

Prerequisite

sudo apt update
sudo apt install software-properties-common -y

Add custom APT repository

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update

Press ENTER to confirm adding repository.

Install Python 3.10

sudo apt install python3.10 python3.10-venv python3.10-dev
python3 --version

You will see previous of Python. At the writing time Python 3.10.16

[!CAUTION]

This may cause problem with terminal not open on Ubuntu

https://askubuntu.com/questions/1397938/terminal-not-opening-after-changing-python-version

ls -la /usr/bin/python3
sudo rm /usr/bin/python3
sudo ln -s python3.10 /usr/bin/python3
sudo ln -s python3.10 /usr/bin/python
python3 --version

Now you will see Python 3.10.x

Install PIP for Python 3.10

curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
python3.10 -m pip --version

Test with system ENV

python3.10 -m pip install ipython

Test with Virtual ENV

python3.10 -m venv venv
pip install ipython

References

https://computingforgeeks.com/how-to-install-python-on-ubuntu-linux-system/

https://gist.githubusercontent.com/rutcreate/c0041e842f858ceb455b748809763ddb/raw/cc6ac984f9eced60bc46d29099c3df64902a66a3/README.md

相关推荐
likfishdn18 分钟前
Linux的文件与目录管理
linux·运维·服务器
chian-ocean38 分钟前
Linux 文件缓冲区:高效数据访问的幕后推手
linux·运维·服务器
加油=^_^=39 分钟前
【Linux】进程优先级 | 进程调度(三)
linux·运维·服务器
若云止水1 小时前
Ubuntu 下 nginx-1.24.0 源码分析 - ngx_init_cycle 函数 - 详解(4)
数据库·nginx·ubuntu
吃汤圆的抹香鲸1 小时前
GoLand 安装包 绿色版 Win,Mac,Linux 包含IntelliJ全家桶 专为Go语言设计的集成开发环境(IDE)
linux·windows·macos·go·intellij-idea·go1.19
追寻光1 小时前
Cannot find a valid baseurl for repo: base/7/x86_64
linux
元气满满的热码式1 小时前
Docker数据卷操作实战
linux·运维·docker·云原生·容器
陆沙1 小时前
deepseek-r1-centos-本地服务器配置方法
linux·服务器·centos
北京耐用通信2 小时前
航空装配自动化神器Ethercat转profient网关搭配机器人精准控制
运维·机器人·自动化
吃汤圆的抹香鲸2 小时前
Rider 安装包 绿色版 Win/Mac/Linux 适合.NET和游戏开发者使用 2025全栈开发终极指南:从零配置到企业级实战
linux·运维·windows·sql·游戏·macos·.net