Transitioning To Python 3

  by Brian Andrus
Transitioning To Python 3 thumbnail

Your Python 2 app may still run. That doesn’t make it supported. Python 2.7 officially reached end of life (EOL) on January 1, 2020, per the Python Software Foundation’s PEP 373, and Python 2.x versions no longer receive support, security updates, or bug fixes from the official developers — so any active project belongs on a supported Python 3 release. The date wasn’t a surprise, either: Python 3.0 first shipped on December 3, 2008, so the two lines coexisted for more than a decade before support for Python 2 finally ended.

Python 2.7 received a five-year support extension, moving its EOL date to 2020 — but that grace period is long gone. Since Ubuntu 22.04 (Jammy) and Ubuntu 24.04 (Noble), Python 2.7 is no longer included in the operating system, and Python 2.x versions are no longer available on servers running these releases. If your code still depends on Python 2, the ground it stands on is disappearing.

This might seem like a daunting transition, especially if you’ve been coding in Python 2.7 for a while. But don’t worry, we’re here to help soften the blow and guide you through this change.

Subscribe now to receive all the latest updates, delivered directly to your inbox.

Which Python versions are supported in 2026?

The current stable release is Python 3.14, first released on October 7, 2025. Python 3.10 through 3.14 are actively supported; every Python 2.x release and every Python 3 release through 3.9 has reached end of life, per the Python Developer’s Guide (updated May 2026).

VersionFirst releaseEnd of lifeStatus
3.14October 7, 2025October 2030Supported (bug fixes)
3.13October 7, 2024October 2029Supported (bug fixes)
3.12October 2, 2023October 2028Supported (security fixes only)
3.11October 24, 2022October 2027Supported (security fixes only)
3.10October 4, 2021October 2026Supported (security fixes only)
3.9October 5, 2020October 31, 2025End of life
3.8October 14, 2019October 7, 2024End of life
3.7June 27, 2018June 27, 2023End of life
2.7July 3, 2010January 1, 2020End of life
Source: Python Developer’s Guide, status of Python versions, May 2026

New Python versions ship each October and get five years of support: roughly two years of bug fixes, then security fixes only. If you’re migrating from Python 2 in 2026, target a currently supported release: Python 3.13 or 3.14 gives your code the longest runway before the next upgrade.

Python vs. python3: what’s the difference?

They’re commands, not different languages; the question is which interpreter each one launches on your system. During the years when Python 2 and Python 3 had to coexist, PEP 394 recommended that python2 run a Python 2 interpreter and python3 run a Python 3 interpreter, while the bare python command was left up to each distribution: it may point to Python 3, point to Python 2 on older systems, or not exist at all. That’s why tutorials tell you to type python3, as it’s the one name guaranteed to reach Python 3. Inside an activated virtual environment, plain python always runs that environment’s interpreter.

Not sure what a command runs on your machine? Ask it: python --version or python3 --version.

Why upgrade from Python 2?

Python 3 is the future, and it’s here to stay. It introduces many improvements and new features that make coding in Python more efficient and enjoyable.

Security and compatibility

The primary concern with continuing to use Python 2.7 (and other older versions) is security. Think of a post-EOL runtime as a building whose landlord has stopped doing repairs: everything keeps working until something breaks, and then no one is coming to fix it. Without ongoing updates and patches, any vulnerabilities discovered post-EOL pose a significant risk to applications and systems still running this version. Moreover, newer operating systems, such as Ubuntu 24.04 (Noble) and later, do not include Python 2.7 at all, creating additional challenges in terms of compatibility and future-proofing your infrastructure.

Enhanced features and improved performance

Python 3 adds f-strings, async functions, modern type-checking tools, and improved memory management.

What actually breaks between Python 2 and Python 3

Python 3.0 was deliberately incompatible with the 2.x line: per python.org’s release notes, “many details, especially how built-in objects like dictionaries and strings work, have changed considerably,” deprecated features were removed, and the standard library was reorganized. These are the changes migrating code trips over most:

What changedPython 2Python 3
printStatement: print "hello"Function: print("hello")
Division5 / 2 returns 25 / 2 returns 2.5 (use // for floor division)
StringsBytes by default, with a separate unicode typeUnicode by default, with a separate bytes type
User inputraw_input()input()
Standard libraryPython 2 module layoutReorganized in prominent places, with renamed modules

Preparing for the transition

This whole process may seem daunting, but with the right resources and planning, this can be a smooth process. Here are some steps to guide you through the migration:

  1. Audit Your Existing Python Codebase: Identify dependencies and third-party libraries that you’re currently using. Check if they are supported in Python 3, and note any that need to be updated or replaced.
  2. Check The Documentation: Familiarize yourself with the functional differences between Python 2.7 and Python 3. Resources like the official Python 3 documentation will provide an excellent starting point. 
  3. Use tools to automate migration: The classic converter, 2to3, can automate much of the translation from Python 2.7 to Python 3. It handles straightforward changes like print statements, raw_input(), and renamed standard-library modules. One big caveat: 2to3 was deprecated in Python 3.11 and removed from the standard library in Python 3.13, so you’ll need to run it under Python 3.12 or earlier. It also can’t fix everything. Integer division changes, for example, are beyond it. AI coding assistants can also translate Python 2 code to Python 3 and draft test scaffolding, though their output needs the same thorough testing as any automated conversion. 
  4. Test Thoroughly: After migrating your code, thorough testing is crucial. Ensure that your updated application performs as expected on Python 3. Unit tests, integration tests, and system tests can all help verify that the transition has not introduced new issues.
  5. Plan For Deployment: Once your application is updated and tested, plan a rollout that minimizes downtime. Consider deploying in stages or using canary releases to mitigate risks.

Transitioning your Python 2.x code to Python 3 might seem like a Herculean task, but the Python community has got you covered. The official Python documentation now collects porting resources (the archived original porting guide plus maintained third-party guides from Fedora, DigitalOcean, and ActiveState) on its “How to port Python 2 Code to Python 3” page.

What if you can’t migrate yet?

Sometimes the blocker isn’t your code. It’s a critical dependency or vendor application that never got a Python 3 port. If that’s you, limit the risk while you work the problem:

  • Isolate the legacy workload. Run the Python 2.7 application in its own container or virtual machine, off the public internet, so an unpatched vulnerability can’t reach the rest of your infrastructure.
  • Replace the blocking dependency. An abandoned Python 2 library may have a maintained Python 3 successor or fork — check PyPI before assuming you’re stuck.
  • Port just the blocker. If the dependency is small and open source, porting it yourself can be cheaper than living with an unsupported stack.

Treat all of these as stopgaps with an end date, not a destination: the repairs aren’t coming, and every day on Python 2.7 is another day without security patches.

While saying goodbye to Python 2.x may be bittersweet for many, the transition to Python 3 is both necessary and beneficial. With improved functionality, enhanced security, and continued support, Python 3 is well-prepared to champion the next generation of development.

How do I run Python 3 on DreamHost?

Python 3 is ready to go: DreamHost installs Python on all of its servers by default, and DreamHost servers run Ubuntu LTS releases — Python 2.7 is no longer available on servers running Ubuntu 22.04 (Jammy) or 24.04 (Noble), per DreamHost’s Python overview and Ubuntu Noble knowledge base articles (updated July 2026). To see what’s installed, connect to your server over SSH and run python3 --version. If your project needs a specific release, DreamHost’s knowledge base walks through installing a custom version of Python 3. DreamHost web hosting covers most Python-backed sites and scripts, and for applications that need more control over the server environment, DreamHost VPS hosting is the better fit.

If you’ve got any questions about this upgrade, please be sure to check out the official Python documentation linked above or reach out to our Technical Support team. We’re standing by, ready to help!

FAQs about transitioning to Python 3

What is the latest Python version?

Python 3.14 is the current stable release, first released on October 7, 2025, per the Python Developer’s Guide. Python 3.15 is in prerelease, scheduled for October 2026.

When did Python 3.7 reach end of life?

Python 3.7 reached end of life on June 27, 2023. Python 3.8 followed on October 7, 2024, and Python 3.9 on October 31, 2025 — the oldest supported version today is Python 3.10.

Is Python 2 still usable?

It still runs, but it hasn’t received security updates since January 1, 2020, and current operating systems like Ubuntu 24.04 no longer package it. Don’t use Python 2 for anything internet-facing.

Does 2to3 still come with Python?

No. 2to3 was deprecated in Python 3.11 and removed from the standard library in Python 3.13, so you’ll need to run it under Python 3.12 or earlier.

Does DreamHost support Python 3?

Yes. DreamHost installs Python on all of its servers by default, and DreamHost’s knowledge base documents how to install a custom version of Python 3 if your project needs a specific release.

Remember, at DreamHost, our goal is to empower you to shape the web as you see fit. We’re here to support you through this transition and help you continue to create amazing things on the web.

Brian is a Cloud Engineer at DreamHost, primarily responsible for cloudy things. In his free time he enjoys navigating fatherhood, cutting firewood, and self-hosting whatever he can.