#install python 3.9
!sudo apt-get update -y
!sudo apt-get install python3.9
#change alternatives
!sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
!sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 2
#check python version
!python --version
#3.9.6
# Choose one of the given alternatives:
!sudo update-alternatives --config python3
# This one used to work but now NOT(for me)!
# !sudo update-alternatives --config python
# Check the result
!python3 --version
# Attention: Install pip (... needed!)
!sudo apt install python3-pip
#install python 3.9
!sudo apt-get update -y
!sudo apt-get install python3.9
#change alternatives
!sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
!sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 2
#check python version
!python --version
#3.9.6
Change Runtime Type and selecting python3