4

I am very confused

after searching a while in google , we found many sites that explain how to install python 3 on rhel 7

I want to explain our needs

we have productions servers , and we want now to add python 3 on all servers

the current python version is python 2.7.5

I also searched on REDHAT sites , but not found formal documentation about latest python 3.x version

what I found is the following site/post

https://www.unixarena.com/2018/05/how-to-install-python-3-on-redhat-enterprise-linux-7-x.html/

we tried it , and we installed successfully the python 3.x version

but the question is , that we not sure if we can trust this post and the python packages

since we are talking on very important and secured servers , we want to be sure about the python 3 installation

please advice - what are the best way to install python 3 on rhel 7.x servers ( better with yum )

we cant download the following rpm's

yum repolist

rhel-7-server-optional-rpms/7Server/x86_64                                   Red Hat Enterprise Linux 7 Server - Optional (RPMs)                                                       22,108
rhel-7-server-rpms/7Server/x86_64                                            Red Hat Enterprise Linux 7 Server (RPMs)                                                                  30,607
rhel-server-rhscl-7-rpms/7Server/x86_64                                      Red Hat Software Collections RPMs for Red Hat Enterprise Linux 7 Server 



 yumdownloader install rh-python38-numpy rh-python38-scipy  rh-python38-python-tools  rh-python38-python-six
Loaded plugins: langpacks, product-id
No Match for argument install
No Match for argument rh-python38-numpy
No Match for argument rh-python38-scipy
No Match for argument rh-python38-python-tools
rh-python38-python-six-1.12.0-10.el7.noarch.rpm    
Judy
  • 1,595
  • 6
  • 19
  • 41
  • This seems to be using EPEL, so it's pretty safe, you can access python 3 by typing `pytthon3` in the terminal – RMPR Oct 11 '20 at 20:34
  • You can also build python from source if you are concerned about security of packages. https://docs.python.org/3/using/unix.html#building-python – jkr Oct 11 '20 at 20:36
  • the problem when installing from source is the installation get too hard ,and we failed many times without success , but yum is very easily , so may I asked what is the differences between source ( as the post - https://www.unixarena.com/2018/05/how-to-install-python-3-on-redhat-enterprise-linux-7-x.html/ , to source ) , is it true that both approach are give the same results? – Judy Oct 11 '20 at 20:38
  • @RMPR , do you have similar post/link that explain how to install python 3.9 version ? – Judy Oct 11 '20 at 20:40
  • Another option is to use virtual environments, like [`virtualenv`](https://virtualenv.pypa.io/en/latest/) or [`conda`](https://docs.conda.io/en/latest/miniconda.html). These solutions work in user-space (no need to be root user) and allow you to install virtually any version of python. – jkr Oct 11 '20 at 20:45

1 Answers1

3

We recommend to use the Python 3 that is available via Red Hat Software Collections. Software collections are part of your RHEL subscription and have their own release cadence so they can be updated more frequently and independent of RHEL OS releases. These are very secure and fully supported by Red Hat. Software collections is now up to Python 3.8. What's great about software collections is that Python 3.8 installations will be exactly the same across your servers - whether you install some today or in 3 months. A problem with other alternatives (e.g. EPEL) is that the package set may be one thing today but be different in 3 months. Also, software collections allow you to install 2 different Pythons in parallel without contention. A lot of RHEL 7 was built on Python 2.7 and installing Python 3 without software collections can potentially (and commonly) break the OS.

To install python 3 on RHEL 7, use these instructions. Installation requires that you need to enable the correct repos, etc. The first time through may be a bit slow, but people have found it to be routine afterwards.

These same software collections are also delivered as Linux containers and can be found in our catalog.

Mike Guerette
  • 533
  • 3
  • 6
  • I download the rpm for @development and also download the latest version - rh-python38-2.0-4.el7.x86_64.rpm , but we not found the other rpm's for python 38 , can you advice why? , example we did - umdownloader rh-python38-numpy or yumdownloader rh-python38-scipy – Judy Oct 12 '20 at 17:44
  • Hmm. As I'm not an expert tbh, but it's possible there were packaging changes with 3.8. Can you try with Python 3.6 and with using Yum rather than yumdownloader? Also, have you installed rh-python38? – Mike Guerette Oct 12 '20 at 21:36
  • I see this also - https://access.redhat.com/errata/RHEA-2020:2261 – Judy Oct 13 '20 at 14:00
  • When Python 3.10 or 3.11 will be available for RHEL7, please? When there will be almost automatic package build just after [Python release](https://www.python.org/downloads/)? – Hans Ginzel Jan 19 '23 at 13:06