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

相关推荐
码农101号3 分钟前
运维安全05 - iptables规则保存与恢复
运维·网络·安全
Empty_7775 分钟前
SELinux安全上下文
linux·服务器·安全
bug攻城狮1 小时前
解决Ubuntu中apt-get -y安装时弹出交互提示的问题
linux·运维·ubuntu
xiachong271 小时前
ubuntu18.04安装PCL1.14
linux·ubuntu
夜阑珊夭夭2 小时前
linux自定义网卡名字
linux·运维
czhc11400756632 小时前
Linux912 shell:$# $1 $?;RHEL 8 AppStream BaseOS
linux
佛天华2 小时前
centos 时间校准
linux·运维·centos
小柯J桑_3 小时前
Linux:线程封装
linux·运维·c++
先锋队长3 小时前
linux系统搭建nacos集群,并通过nginx实现负载均衡
linux·nginx·负载均衡