Search code examples
pythonpython-3.xgoogle-colaboratorycompatibility

Why is Colab still running Python 3.7?


I saw on this tweet that Google Colab move to Python 3.7 on February 2021. As of today however (January 2022), Python 3.10 is out, but Colab still runs Python 3.7.
My (voluntarily) naive take is that this is quite a significant lag.

Why are they not at least on Python 3.8 or even 3.9?
Is it simply to make sure that some compatibility criteria are met?


Solution

  • The only reason is that they want to have the most compatible version of Python worldwide. According to the Python Readiness report (Python 3.7 Readiness), version 3.7 supports almost 80.6% of the most used packages so far. Still, this coverage is 78.3% for version 3.8, 70.6% for version 3.9, and 49.7% for version 3.10 (as of March 29, 2022).

    They still use this version today if Python 3.6 was not in its EOL. Lucky us, python.org decided to get rid of versions below 3.7. 😊

    On the other hand, you can update the Python version in your Colab by running some Linux commands in the notebook. However, whenever you start a new notebook, Google ignores the updates and returns to the original version.

    Google should provide options for selecting the Python version. Because of this, I do not use Colab in most cases, especially when teaching Python to my students.

    Update (January 12, 2023):

    Now, Google Colaboratory supports Python 3.8.16 Python 3.8 Readiness. After a long time, we see some improvement. But it's still outdated because the current version is 3.11.1. The Python Readiness report says 80.8% of most used packages support Python 3.8, and 30.6% support 3.11. But we know this information comes from info on PyPi. In practice, this support is far more than what the package maintainer says in the repository. Many packages support 3.11, but they still mention the lower version of Python. The reason is that the maintainer hasn't had a chance to check and update their production yet.

    Update (May 07, 2024):

    Fortunately, we have seen more activities on the Google server admins recently 😉. It has been around three months since Google's admins updated Python to version 3.10 (Python 3.10 Readiness), and the current version that colab supports by default is 3.10.12, which is still old (the current stable version of Python is 3.12.3)). The funny part is that they didn't update it at least to 3.10.14, the current version of Python 3.10. "Half a loaf is better than none."