Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Downgrade python version from 3.7 to 3.6 in google colab

Some python packages wont work in python 3.7 . So wanted to downgrade the default python version in google colab.Is it possible to do? If so how to proceed.Please guide me..

like image 500
B.Thushar Marvel Avatar asked Mar 24 '21 06:03

B.Thushar Marvel


People also ask

How do I downgrade to a specific version of Python?

We can remove and install the required version of Python to downgrade it. First, we need to download the package from the official website and install it. Then, we need to go to the Frameworks\Python. framework\Versions directory and remove the version which is not needed.

Which version of Python does colab use?

The reason is simple - Colab ships with Python 3.7, and our recommended version is 3.8 or later.


1 Answers

You could install python 3.6 with miniconda:

%%bash

MINICONDA_INSTALLER_SCRIPT=Miniconda3-4.5.4-Linux-x86_64.sh
MINICONDA_PREFIX=/usr/local
wget https://repo.continuum.io/miniconda/$MINICONDA_INSTALLER_SCRIPT
chmod +x $MINICONDA_INSTALLER_SCRIPT
./$MINICONDA_INSTALLER_SCRIPT -b -f -p $MINICONDA_PREFIX

And add to path:

import sys
_ = (sys.path.append("/usr/local/lib/python3.6/site-packages"))
like image 166
RJ Adriaansen Avatar answered Sep 21 '22 08:09

RJ Adriaansen