Skip to main content
Redhat Developers  Logo
  • Products

    Platforms

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat AI
      Red Hat AI
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • View All Red Hat Products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat Developer Hub
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat OpenShift Local
    • Red Hat 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
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Secure Development & Architectures

      • Security
      • Secure coding
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud 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

    • Product Documentation
    • API Catalog
    • Legacy Documentation
  • 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

Python 2 support is going away soon: Make the move to Python 3

October 25, 2019
Langdon White
Related topics:
Python

Share:

    Seeing this tweet from Guido van Rossum the other day prompted me to write this "OMG, Python 2 is going away SOON" article. You have definitely heard it before, but seriously, folks, the Python upstream community is ending support for Python 2 at the end of the year!

    Let's stop saying "2020" because that sounds far away when, in fact, we are talking about January 1, 2020, which is two and half months from now. In this article, I'll provide some quick links and basic information to help you make the move to Python 3.

    Moving to Python 3

    I hope that you have already been convinced about why you should move to Python 3 but, if not, you should definitely check out Nick Coghlan’s Python 3 Q&A and Brett Cannon’s Why Python 3 exists (as recommended by the Python porting page). Speaking from my own experience, I find Python 3 to be much more consistent in language constructs and way more in line with the "batteries included" philosophy.

    Personally, my hesitation would be directly related to how much of the ecosystem is already on Python 3. In other words, language adoption is often more about the ecosystem than it is about the language itself.

    The ecosystem is ready

    Let me assure you; the ecosystem is ready. According to the Python Porting DB nearly 90% of Fedora Python Libraries support Python 3. Perhaps more concerning for those of you who are still on Python 2, 80% of the libraries only support Python 3. If you have any doubts about the particular libraries you need, you can use the caniusepython3 tool to be sure.

    If you are worried about how much work it will be to move to Python 3, well, the Python Community has also gone to great lengths to make it as easy as possible. Specifically, check out tools like Futurize (which passes Python 2 code through appropriate fixers and turns it into valid Python 3 code) and Modernize (which makes Python 2 code more modern for porting to Python 3). The community has also provided a linter that will prove to you that you have cleaned everything up.

    However, all that said, there is always the problem of testing. No one at Red Hat or in the Python community can help you create tests that don't exist. If you don't have great test coverage, maybe this can be an opportunity to add tests. Then, the next time you want to do a refactor or introduce a new feature, you don't have to be so frightened :).

    Heed the call

    All in all, now's the time to heed Guido's call to action. Everything is ready for you to move. And, you really shouldn't have to do this again for a good long time, because Python 3 will be supported until the end of the Red Hat Enterprise Linux 8 lifecycle. If you can't commit quite yet, we still have your back for a couple more years with our expected retirement of Python27 in 2024.

    Other resources

    • Red Hat Software Collections
    • What, no Python in Red Hat Enterprise Linux 8?
    • How to install Python 3 on Red Hat Enterprise Linux
    • Develop with Django 2 and Python 3 in a container with Red Hat Enterprise Linux
    Last updated: July 1, 2020

    Recent Posts

    • Cloud bursting with confidential containers on OpenShift

    • Reach native speed with MacOS llama.cpp container inference

    • A deep dive into Apache Kafka's KRaft protocol

    • Staying ahead of artificial intelligence threats

    • Strengthen privacy and security with encrypted DNS in RHEL

    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
    © 2025 Red Hat

    Red Hat legal and privacy links

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

    Report a website issue