Is there a way to use Python 3.5 instead of 3.6?

There is a way to use any version of python you want 3.5 or 3.8 in this example, without having to run a kernel locally or going through an ngrok proxy.

Download the colab notebook. Open a text editor to change the kernel specification to:

"kernelspec": {
  "name": "py38",
  "display_name": "Python 3.8"
}

This is the same trick as the one used with Javascript, Java, and Golang.

Then upload the edited notebook to Google Drive. Open the notebook in Google Colab. It cannot find the py38 kernel, so it use normal python3 kernel.
You need to install a python 3.8, the google-colab package and the ipykernel under the name you defined above: “py38”:

!wget -O mini.sh https://repo.anaconda.com/miniconda/Miniconda3-py38_4.8.2-Linux-x86_64.sh
!chmod +x mini.sh
!bash ./mini.sh -b -f -p /usr/local
!conda install -q -y jupyter
!conda install -q -y google-colab -c conda-forge
!python -m ipykernel install --name "py38" --user

Reload the page, and voilĂ , you can test the version is correct:

import sys
print("User Current Version:-", sys.version)

A working example can be found there.

Leave a Comment