-4

As of 2021, which python version is Google Colab using? I want to use Python 3.8 for the coding on Google Colab, is it possible?

Thanking you

Mini N
  • 11

3 Answers3

3

Google Colab uses Python 3.6.9 as of 2021.

The only way to use Python 3.8 would be to connect to a local runtime. But, that'll kill the purpose of Colab.

Previous Answers:

vigviswa
  • 69
  • 8
2

According to their FAQ they are actively phasing out Python 2 in favor of Python 3. There are some breaking changes between early versions of Python 3.x and later ones, but these largely occurred prior to most of the world making the jump to Python 3. You are probably safe using Python 3.8 for this reason alone, but given the way workbooks run you're probably safe from multiple angles.

The easiest way to build confidence Python 3.8 is compatible with what you want to do is to try it out - or at least a snippet. Import a library, instantiate an object, do some trivial manipulation of it and check that it works. If no errors arise when you run it you're probably fine for most things - and where you might not be the error messages will be your guide.

...time passes...

So, I dug deeper and the FAQ links to Python 3.9 - so it should be fine for most cases. It is the case, however, that Google has only declared 3.6 support (so far as I can tell). That said, I'd be surprised if you ran into any real incompatibilities. If their runtime is on 3.6 you won't be able to use walrus operators or position-only params, along with a handful of other features. Also, dictionaries will work differently under the hood (which may affect your programs behavior if you rely on that). That said, in truth these are edge-ish cases; is there a feature in particular you are worried about?

Nathaniel Ford
  • 16,853
  • 18
  • 74
  • 88
1

I make a library to help with this (and other issues)

!pip install kora -q
import kora.install.py38

Wait a bit, then click the link.

korakot
  • 24,489
  • 13
  • 84
  • 114