Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use Python 2 on Google Colab?

How can I use the earlier version of Python i.e version 2.x?

Under the 'change runtime' option - I can see the option for selecting hardware accelerator.

like image 520
Prachi Avatar asked Apr 28 '20 07:04

Prachi


People also ask

Does Google colab use Python 2?

Python 2 is no longer supported in Colab. For information on migrating your code from Python 2 to Python 3, see Porting Python 2 Code to Python 3.

Can I change Python version in Google Colab?

Step 2: Configure the python It will ask the to type the selection number. Choose the number corresponding to your version. It will change the version of python. In this example, it is 3.7 so type 3 and enter.

How do I install a different version of Python in Colab?

To use another python version in google colab, you need to: 1- Installing Anaconda. 2- Adding (fake) google colab library. 3- Starting Jupyterlab. 4- Accessing it with ngrok.


1 Answers

You can use these 2 shortcuts to create a Python 2 Colab.

  • bit.ly/colabpy2
  • colab.to/py2

They will forward to this URL.

https://colab.research.google.com/notebook#create=true&language=python2

like image 182
korakot Avatar answered Oct 10 '22 03:10

korakot