Python 官方文档:入门教程 => 点击学习
一、已有Python版本 使用以下命令查找系统上所有安装的 python 版本 ls /usr/bin/Python* 使用以下命令更改 Python 3 的符号链接 sudo update-alternatives --install
一、已有Python版本
使用以下命令查找系统上所有安装的 python 版本
ls /usr/bin/Python*
使用以下命令更改 Python 3 的符号链接
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
3.使用以下命令检查 Python 3 符号链接的当前版本
python3 --version
二、下载所需版本
使用以下命令安装软件包
sudo apt-get updatesudo apt-get install software-properties-common
添加 deadsnakes PPA 存储库,该存储库包含最新的 Python 版本
sudo add-apt-repository ppa:deadsnakes/ppa
安装 Python 3.10
sudo apt install python3.10
更新 Python 3 的符号链接,以便将其设置为默认版本
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
使用以下命令更改默认 Python 3 版本
sudo update-alternatives --config python3
该命令将显示所有可用的 Python 3 版本。输入所选版本的编号并按 Enter 键
使用以下命令检查 Python 3 符号链接的当前版本
python3 --version
来源地址:https://blog.csdn.net/qq_51756940/article/details/130384866
--结束END--
本文标题: ubuntu升级Python版本
本文链接: https://www.lsjlt.com/news/392766.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0