问题描述
Ubuntu22.04系统自带Python3.10,想升级到最新版Python
解决方法
1. 安装 Python3.11
apt-get update
apt install python3.112. 更新python3的命令链接,设置为默认版本(注意最后一个参数是1)
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 13. 更改默认python3 版本
update-alternatives --config python3该命令会显示本地所有可用的Python3版本。输入所选版本的编号并确认
确认Python3 版本
python3 -V