Notice: While JavaScript is not essential for this website, your interaction with the content will be limited. Please turn JavaScript on for the full experience.

Sunsetting Python 2

We are volunteers who make and take care of the Python programming language. We have decided that January 1, 2020, was the day that we sunset Python 2. That means that we will not improve it anymore after that day, even if someone finds a security problem in it. You should upgrade to Python 3 as soon as you can.

Why are you doing this?

We needed to sunset Python 2 so we can help Python users by improving Python faster.

We released Python 2.0 in 2000. We realized a few years later that we needed to make big changes to improve Python. So in 2006, we started Python 3.0. Many people did not upgrade, and we did not want to hurt them. So, for many years, we have kept improving and publishing both Python 2 and Python 3.

But this makes it hard to improve Python. There are improvements Python 2 can't handle. And we have less time to work on making Python 3 better and faster.

And if many people keep using Python 2, then that makes it hard for the volunteers who use Python to make software. They can't use the good new things in Python 3 to improve the tools they make.

We did not want to hurt the people using Python 2. So, in 2008, we announced that we would sunset Python 2 in 2015, and asked people to upgrade before then. Some did, but many did not. So, in 2014, we extended that sunset till 2020.

How long is it till the sunset date?

The sunset date has now passed; it was January 1st, 2020.

What happens now?

As of January 1st, 2020 no new bug reports, fixes, or changes will be made to Python 2, and Python 2 is no longer supported.

A few changes were made between when we released Python 2.7.17 (on October 19th, 2019) and January 1st. As a service to the community, we bundled those fixes (and only those fixes) and released a 2.7.18. We did that in April 2020, because that was convenient for the release managers, not because it implied anything about when support ended. For more technical details, please see this explanation.

What will happen if I did not upgrade by January 1st, 2020?

If people find catastrophic security problems in Python 2, or in software written in Python 2, then most volunteers will not help fix them. If you need help with Python 2 software, then many volunteers will not help you, and over time fewer and fewer volunteers will be able to help you. You will lose chances to use good tools because they will only run on Python 3, and you will slow down people who depend on you and work with you.

Some of these problems started on January 1. Other problems will grow over time.

I wrote code in Python 2. How should I port it to Python 3?

Please read the official "Porting Python 2 Code to Python 3" guide. Please also read the Python 3 Statement Practicalities for advice on sunsetting your Python 2 code.

I'm not sure whether I depend on any software written in Python 2. What should I do?

If you buy software or software support from vendors, ask them. If you pay developers or system administrators, ask them. If you don't have vendors or technical staff, then use "Can I Use Python 3?" to find out whether you depend on any software written in Python 2.

To find out more about whether specific tools can work with Python 3, look at Python 2.7 Readiness, the Python 3 Statement, and Python 3 Readiness.

I depend on some software written in Python 2. What should I do?

If you buy software or software support from vendors, ask them. If you pay developers or system administrators, ask them. If you don't have vendors or technical staff, then use "Can I Use Python 3?" to find out which tools you need to upgrade to Python 3.

Is there anyone who can help me?

Yes. If you can pay for extended support, talk to one of these vendors. If you can pay to hire someone to help you, post on the job board or hire a consultant. If you need free help from volunteers, look at this help page.

I didn't hear anything about this till just now. Where did you announce it?

We talked about it at software conferences, on the Python announcement mailing list, on official Python blogs, in textbooks and technical articles, on social media, and to companies that sell Python support.

How can I make sure announcements like this don't surprise me again?

Buy Python support from a vendor, or subscribe to the Python announcement mailing list.

I have more questions.

Read this detailed list of Python 3 Questions and Answers.