首页 > 解决方案 > 如何在 Linux RHEL 上升级 Python 3?

问题描述

我有一个 Linux 的 Rhel 版本,想从 Python 3.6 升级到 3.7.2

什么是最好的和行之有效的方法?

用 yum 试过,但似乎没有最新版本的 python ..

标签: pythonlinuxrhel

解决方案


分享对我有用的东西。在 Enterprise RHEL 7 上为我工作。

#-> python --version
Python 2.7.5

#-> yum install rh-python38

#-> scl enable rh-python38 bash

#-> python --version
Python 3.8.0

但是你每次都会进入 scl shell,因为默认的 shell 仍然是 Python 2.7。为了使这个永久化,我不得不

将此添加到我的~/.bash_profile

source /opt/rh/rh-python38/enable

推荐阅读