Wed. Dec 11th, 2019

RHEL 8 doesn’t set any Python version as the default version

2 min read

Most Linux distributions, including RHEL, are generally limited by default to the Python version provided by the system unless they leave the system’s package manager environment. This is common for many tools like Ruby, Node, Perl, and PHP, but Python is a bit more complicated because many Linux tools like yum rely directly on Python.

python 3

According to PEP 394, /usr/bin/python currently refers to Python2, which is the “Python” command or the Python interpreter will point to the Python2 version by default. Red Hat officially wrote on its developer blog that in order to improve the user experience, RHEL 8 Beta “have moved the Python used by the system “off to the side” and we introduced the concept of Application Streams based on Modularity.

They use a modular Application Streams design, combined with Python’s multi-version simultaneous installation features, will provide users with multiple versions of Python options, and can be easily installed from standard repositories to standard locations, users can choose what they want in any The version of Python running in the given user space.

“As a result, we came to the tough conclusion, don’t provide a default, unversioned Python at all. Ideally, people will get used to explicitly typing python3 or python2. However for those that want an unversioned command,  let them chose from the beginning which version of Python they actually want. So, yum install python results in a 404.

However, we do try to make it as easy as possible to get Python 2 or 3 (or both) on to your system. We recommend using yum install @python36 or yum install @python27 to take advantage of the recommended set of packages to install. If all you really need is *just* the Python binaries, you can use yum install python3 or yum install python2.”