I downloaded python version 3.8 on google colab using:
!apt-get install python3.8
Now I want to change the default python version used in google colab
uses from 3.6
to 3.8
. how to do it??
I have read few ans but there are no updates...
I downloaded python version 3.8 on google colab using:
!apt-get install python3.8
Now I want to change the default python version used in google colab
uses from 3.6
to 3.8
. how to do it??
I have read few ans but there are no updates...
In my opinion there is no "good" way to do this. What you can do is start your script with a shebang line. A shebang line will set the python version for the following code. Find some related answers and informations here. How do I tell a Python script to use a particular version
Find here some informations on how to use shebang in colab. https://colab.research.google.com/github/jhermann/blog/blob/master/_notebooks/2020-02-28-env_with_arguments.ipynb#scrollTo=SYv4FagrzLVu
When you have script for more versions of python you might come across this issue. Dealing with multiple python versions when python files have to use #!/bin/env python
try these commands
!update-alternatives --install /usr/bin/python python /usr/bin/python3.8
then
!update-alternatives --list python
this must display your downloaded python version
after that
!sudo update-alternatives --config python
## !Set python3.8 as default.
finally
!sudo update-alternatives --set python /usr/bin/python3.8
then check your default python version on colab
!python3 --version