DEV Community

PyLenin
PyLenin

Posted on

Migration to Python 3 is still very slow

I was just going through Stack Overflow and I realized that people are still asking questions about Python 2.7. Surely, a lot of them are about ways to migrate to Python 3, but still, there were a lot of questions being asked on functionality.

That got me curious and I started researching PyPI package downloads for Python 2.7. I came across this page and saw how one can look into the number of installations of various libraries for various Python versions.

I specifically used this query to find the number of library downloads per Python version.

SELECT
  REGEXP_EXTRACT(details.python, r"[0-9]+\.[0-9]+") AS python_version,
  COUNT(*) AS num_downloads,
FROM `bigquery-public-data.pypi.file_downloads`
WHERE
  -- Only query the last 6 months of history
  DATE(timestamp)
    BETWEEN DATE_TRUNC(DATE_SUB(CURRENT_DATE(), INTERVAL 6 MONTH), MONTH)
    AND CURRENT_DATE()
GROUP BY `python_version`
ORDER BY `num_downloads` DESC
Enter fullscreen mode Exit fullscreen mode

The results have totally surprised me. There have been more than 5.5 billion package downloads for Python 2.7 just in the last 6 months and it is more than the number of installations for Python 3.9!

Number of package installations categorized by Python versions

This shows that people are not really migrating to Python 3, even with all the support down for Python 2!!

I mean, it both surprises me and confuses me! If anyone reading this is also one of the above, I highly recommend you moving to Python 3 as soon as possible. You are missing out on a lot of advantages.

Just for you, I wrote this blog to showcase the advantages of Python 3 over Python 2. If you are interested, please take a look. And if it helps you to move on to Python 3, I would be very happy!

Top comments (0)