在 CentOS 7 上yum安装 Python 3.8(SCL)

该博客介绍了如何在CentOS7系统中通过软件集合(SCL)来安装Python3.8。首先,通过运行`yum install -y centos-release-scl`添加仓库,然后使用`yum install -y rh-python38 which`进行安装。确认安装成功后,利用`scl enable rh-python38 bash`激活环境,并验证了Python3.8的安装路径和版本。注意,此技术在2023-05至2024-06期间可能已到达EOL,因此可能不再接收安全更新。

介绍

使用软件集合 (SCL) 在 CentOS 7 上安装 Python 3.8

支持

当引入这项技术时,红帽软件集合产品生命周期 - 红帽客户门户网站比,2023-052024-06 似乎是 EOL。
在此之后报告的漏洞和错误的响应可能无法实施。

日志

仓库注册

# yum install -y centos-release-scl

安装

# cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)

# yum install -y rh-python38 which
# scl enable rh-python38 bash
... 略

各种确认

# which python{,2,3}
/opt/rh/rh-python38/root/usr/bin/python
/usr/bin/python2
/opt/rh/rh-python38/root/usr/bin/python3

# ll /opt/rh/rh-python38/root/usr/bin/python*
lrwxrwxrwx. 1 root root     9 Jun 24 10:31 /opt/rh/rh-python38/root/usr/bin/python -> ./python3
lrwxrwxrwx. 1 root root     9 Jun 24 10:31 /opt/rh/rh-python38/root/usr/bin/python3 -> python3.8
-rwxr-xr-x. 1 root root 15280 May 28 09:39 /opt/rh/rh-python38/root/usr/bin/python3.8

# python -V
Python 3.8.0

# python3 -V
Python 3.8.0

# yum info rh-python38
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: ftp.riken.jp
 * centos-sclo-rh: ftp.riken.jp
 * centos-sclo-sclo: ftp.riken.jp
 * extras: ftp.riken.jp
 * updates: ftp.riken.jp
Installed Packages
Name        : rh-python38
Arch        : x86_64
Version     : 2.0
Release     : 4.el7
Size        : 0.0
Repo        : installed
From repo   : centos-sclo-rh
Summary     : Package that installs rh-python38
License     : GPLv2+
Description : This is the main package for rh-python38 Software Collection.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值