使用软件集合 (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.
该博客介绍了如何在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,因此可能不再接收安全更新。

1931

被折叠的 条评论
为什么被折叠?



