Almalinux 8.x compatible on python 2

Hi
Our customer will be consuming Almalinux 8.x.
But we do have a query will it be supported on Python 2 or Python 3.
If only on Python 3 can we make it compatible for Python 2 to deploy 8.x ??

You can have both present. Python3 is the default now, but it is possible to install python2 as well. To use python2 you need to use the command python2 or refer to /bin/python2. Depending upon how your system is configured the simple command python (or explicitly /bin/python) will either run python3 or else do nothing.

For reference, on my system there is:

/bin/python -> /etc/alternatives/unversioned-python
/bin/python2 -> python2.7
/bin/python2.7
/bin/python3 -> /etc/alternatives/python3
/bin/python3.6 -> /usr/libexec/platform-python3.6

and the corresponding

/etc/alternatives/python → /usr/bin/python3
/etc/alternatives/python3 → /usr/bin/python3.6
/etc/alternatives/unversioned-python → /usr/bin/python3

Have a look at dnf list python2\*

1 Like

AlmaLinux has five Pythons. One python for system tools (e.g. dnf) and four in the AppStream for user applications:

# dnf -q module list python*
AlmaLinux 8 - AppStream
Name                                       Stream                                       Profiles                                           Summary
python27                                   2.7 [d]                                      common [d]                                         Python programming language, version 2.7
python36                                   3.6 [d][e]                                   build, common [d]                                  Python programming language, version 3.6
python38                                   3.8 [d]                                      build, common [d]                                  Python programming language, version 3.8
python39                                   3.9 [d]                                      build, common [d]                                  Python programming language, version 3.9

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

The python27 module has Jun 2024 as retirement date in RHEL 8. See Red Hat Enterprise Linux 8 Application Streams Life Cycle - Red Hat Customer Portal

So, yes, it is possible to install python-2.7 into AlmaLinux 8 and run applications that require python-2.7. The system itself does not use python-2.7.

Note also that python-2.7 is already dead. Red Hat will maintain the zombie for couple more years, but everyone should be porting their python codebase already yesterday.

1 Like

Hi:
Red Hat Enterprise Linux 8 Application Streams Life Cycle - Red Hat Customer Portal mentions Python 3.9 retirement date as May 2024.

Does it mean after May 2024 Python 3 is no longer supported ?

Regards,
Venkat

Base system’s python is 3.6. It is supported to 2029.

Upstream will release at least 3.10 and 3.11 before 2024. AppStream will probably have streams for those.