Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

What, no Python in Red Hat Enterprise Linux 8?

 

May 7, 2019
Langdon White
Related topics:
Linux
Related products:
Red Hat Enterprise Linux

Share:

    TL;DR Of course we have Python! You just need to specify whether you want Python 3 or 2 as we didn’t want to set a default. Give yum install python3 and/or yum install python2 a try. Or, if you want to see what packages we recommend, use yum install @python36 or yum install @python27. Read on for why.

     

    For prior versions of Red Hat Enterprise Linux, and most Linux distributions, users have been locked to the system version of Python unless they got away from the system’s package manager. Although this can be true for a lot of tools (Ruby, Node, Perl, PHP), the Python use case is more complicated because so many Linux tools (like yum) rely on Python. To improve the experience for Red Hat Enterprise Linux 8 users, we have moved the Python used by the system “off to the side” and introduced the concept of Application Streams based on Modularity.

    Through Application Streams, in combination with Python’s ability to be parallel installed, we can now make multiple versions of Python available and easily installable, from the standard repositories, into the standard locations. No extra things to learn or manage. Now, users can choose what version of Python they want to run in any given userspace and it simply works. For more info, see Introducing Application Streams in RHEL 8.

    To be honest, the system maintainers also get some advantages of not being locked to an aging version of Python for our system tools. With users not relying on a particular version of Python coming with the system installation, we have the freedom to take advantage of new language features, performance improvements, and all the other goodness a developer gets when tracking near the upstream version.

    However, this has resulted in a dilemma. When a user sits down at a fresh installation of Red Hat Enterprise Linux 8, they will naturally expect that /usr/bin/pythonwill run some version of Python. If you follow the recommendation in Python Enhancement Proposal (PEP) 394, that will be Python 2. However, at some point, a new PEP will likely want to change that recommendation to Python 3, probably during the typically *10* year life of Red Hat Enterprise Linux 8. To put this in perspective, consider that Red Hat Enterprise Linux 7 was released in 2014, and will be supported until 2024!

    So, what do we do? Well, if we follow the current recommendation, we make some present-day users happy. However, when the Python community shifts to recommending Python 3 as the default, we will make new users unhappy.

    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, those that want an unversioned command can choose 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 @python36or 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.

    We have also set up the alternatives infrastructure so that when you install either (or both) you can easily make /usr/bin/python point to the right place using alternatives --config python. However, as we explained above, and aligned with the Python PEP, we don’t recommend relying on /usr/bin/python being the correct Python for your application.

    Note: the same issue arises for Python wrapper scripts like pip. Installing Python 3 will put pip3 in your path, but not unversioned pip. With Python modules like pip, venv, and virtualenv, you can avoid confusion and get the right version by running those as a module: python3 -m pip and avoiding the wrapper scripts. Using Python virtual environments is a best practice that also avoids the issues with version ambiguity, see How to install Python 3 on Red Hat Enterprise Linux 7 for virtual environment details and advice.

    To conclude, yes, Python is included in Red Hat Enterprise Linux 8. And, it will be even better than in the past. If you want more details, refer to the How To Guide on Red Hat Developers.

    And if you haven’t downloaded Red Hat Enterprise Linux 8 yet, go to developers.redhat.com/rhel8 now.

    Additional Information

    • Red Hat Enterprise Linux 8 for developers
    • Introducing Application Streams in RHEL 8
    • Petr Viktorin’s Python on RHEL 8 article  (see the discussion of Platform Python)
    • Introducing CodeReady Linux Builder
    • Containers without daemons: Podman and Buildah available in RHEL 7.6 and RHEL 8 Beta
    Last updated: March 27, 2023

    Recent Posts

    • Boost GPU efficiency in Kubernetes with NVIDIA Multi-Instance GPU

    • How to integrate Senao SX904 into an OpenShift cluster

    • How to start configuration as code for an Ansible instance

    • PowerUp 2025 Wrap up - Thoughts from the Red Hat Team

    • How to simulate network latency in local containers

    What’s up next?

     

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue