安装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

相关推荐
奋斗的好青年6 分钟前
Ubuntu+Windows双系统修复引导+更改启动顺序
linux·windows·ubuntu
yiSty15 分钟前
Windows 10/11下安装WSL Ubuntu
linux·windows·ubuntu
CHANG_THE_WORLD16 分钟前
vcpkg自动化安装库的界面程序
运维·自动化
编程研究坊21 分钟前
LabelStudio linux 系统下部署教程
linux·运维·服务器
取加若则_23 分钟前
gcc/g++
linux·gcc/g++
ybdesire25 分钟前
在CentOS 7安装配置CodeQL与运行QL扫描
linux·运维·centos
waves浪游38 分钟前
进程控制(下)
linux·运维·服务器·开发语言·c++
ai_xiaogui43 分钟前
Debian系统PVE虚拟机安装详解:ISO镜像上传+硬件配置+图形化安装指南
运维·debian·php·panelai兼容测试·图形化安装指南·iso镜像上传配置·debian pve虚拟机安装
周周记笔记1 小时前
Ubuntu 中如何配置域名
运维·服务器
KYGALYX1 小时前
Win10/11系统下WSL2+Ubuntu的全流程安装
linux·运维·ubuntu