Change Python Version in Colaboratory
!sudo apt-get update -y !sudo apt-get install python3.11 !sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1 !sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2 !python --version
If using pip, you will also need to update to pip3:
!sudo apt-get install python3-pip
Do you want learn to code? Enroll in this FREE Python and Data Science course that’s available for a limited time. Start earning your way to a coding career today