How to upgrade Python 3 on Linux RHEL?
Asked Answered
C

2

5

I have a Rhel version of a Linux and would like to upgrade from Python 3.6 to 3.7.2

What is the best and proven way to do it?

Tried with yum but seems that does not have latest versions of python..

Conjunct answered 22/3, 2019 at 11:44 Comment(5)
Possible duplicate of How to upgrade Python version to 3.7?, How to Install Python 3.7.2 on CentOS/RHEL 7/6, How to install Python 3 on Red Hat Enterprise Linux, How to upgrade to python 3.7 on Fedora or Centos, etc.Lineup
^^ that's a little different since Ubuntu is a different OS, if you want a specific RHEL solution, have you enabled subscription-manager?Nihhi
Did not use subscription-manager. What is the process for it? Does CentoOS has as well?Conjunct
CentOS does not use subscription-manager. Configuration of RPM channels varies quite a bit between CentOS and Red Hat Enterprise Linux, so which is it?Haematin
Currently I have a need or Rhel server.. but there are few other servers that are CentOS that also need the same python upgrade..Conjunct
C
4

Sharing what worked for me. Worked for me on Enterprise RHEL 7.

#-> python --version
Python 2.7.5

#-> yum install rh-python38

#-> scl enable rh-python38 bash

#-> python --version
Python 3.8.0

But you will have enter into the scl shell everytime as the default shell would still be Python 2.7. To make this permanent, I had to

Add this to my ~/.bash_profile

source /opt/rh/rh-python38/enable
Counterweigh answered 6/8, 2020 at 21:4 Comment(0)
M
3

Below command worked for me.

sudo dnf install python3.8 -y

I wanted to use python3.8 and removed old python3.6 and installed python3.8 using above command

command to remove python3.6

sudo dnf remove python3.6 -y
Makassar answered 5/9, 2021 at 10:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.