一行命令安装Python3.11/3.10/3.9 Ubuntu升级Python

47 篇文章 1 订阅

(注: 仅适用于Linux系统, 如果是windows系统请自行前往官网python.org 或国内源https://mirrors.huaweicloud.com/python下载.exe文件然后手动安装)

ubuntu22.04/ubuntu20.10和ubuntu18.04亲测可用, 其他linux系统没测过, 欢迎反馈结果

sh -c "$(curl -fsSL https://raw.githubusercontent.com/waketzheng/carstino/master/did_upgrade_py.sh)"

wget https://raw.githubusercontent.com/waketzheng/carstino/master/upgrade_py.py && python upgrade_py.py

git clone git@github.com:waketzheng/carstino.git
cd carstino
sh did_upgrade_py.sh

脚本采用源码安装的方式,整个过程大概需要15分钟左右

它大致相当于执行如下命令:

wget https://.../Pythonxxx.tar.xz && tar xf Pythonxxx.tar.xz && cd Pythonxxx && ./configure && make && make install

如果想安装其他版本的python,可以执行: 

sh did_upgrade_py.sh -v 310 # 安装Python3.10
sh did_upgrade_py.sh -v 39 # 安装Python3.9
sh did_upgrade_py.sh -v 38 # 安装Python3.8
sh did_upgrade_py.sh -v 312 # 安装Python3.12

  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值