MITB Banner

Explained: How To Access JupyterLab On Google Colab

Share

Integrated Development Environments (IDEs) have emerged as one of the fundamental tools in the software development process. IDEs give developers flexibility by integrating various platforms and different processes. According to the Data Science Skills Study 2020 by AIM, of all the IDEs, Jupyter Notebook is the most preferred among data scientists and practitioners. JupyterLab is known as the next-generation web-based user interface for Project Jupyter.

JupyterLab is a web-based interactive development environment for Jupyter notebooks, code, and data. It is one of the most loved IDEs by the data science community, thanks to its intuitive features. For instance, JupyterLab can configure and arrange the user interface to support a wide range of workflows in data science, scientific computing, and machine learning. The IDE is also extensible and modular as it can write plugins that add new components and integrate with existing ones.

JupyterLab offers full support for Jupyter Notebooks and enables users to use text editors, terminals, data file viewers, and other custom components side by side with notebooks in a tabbed work area. It is built on top of an extension system to customise and enhance JupyterLab by installing additional extensions.

Google Colab or Collaboratory is a popular tool for machine learning research and education. Colab comes with a lot of Python libraries pre-installed to help data scientists work efficiently. 

To access JupyterLab on Google Colab:

Step 1:

Open a new Notebook on Google Colab

Step 2:

Switch the backend into either GPU or TPU to run complex computations in an efficient manner. To do so, 

Select Runtime -> Change Runtime Type 

Step 3:

Install ColabCode, a Python package to run the code server from the Google Colab Notebook. The package can be used to start a JupyterLab through Google Colab. ColabCode also has a command-line script.

To install ColabCode, run the following

$ pip install colabcode

Step 4: 

In order to run JupyterLab on Google Colab, type the following on a new Colab cell-

import colabcode as cc

cc.ColabCode(port = 10000,  lab = True)

Step 5: 

Running step 4 will generate a new link through NgrokTunnel. This also generates a new JypterLab token. The code server can be accessed on NgrokTunnel. ngrok is a reverse proxy that creates a secure tunnel from a public endpoint to a locally running web service. ngrok captures and analyses all traffic over the tunnel for later inspection and replay.

Step 6: 

Copy paste the generated JupyterLab token on the “Token” field of the new tab. This will open the JupyterLab.

Step 7:

To cross-check, whether your JupyterLab is running on Google Colab or not, use the following code-

if ‘google.colab’ in str(get_ipython()):

    print(‘Running on Google Colab’)

else:

    print(‘Not Running!’)

Wrapping Up:

Accessing JupyterLab on Google Colab allows the use of intuitive features of JupyterLab on Colab. For instance, using Jupyterlab you can code in languages like Python, R and Swift. You can also access JupyterLab on Kaggle Notebook. 

Click here to know more. 

Share
Picture of Ambika Choudhury

Ambika Choudhury

A Technical Journalist who loves writing about Machine Learning and Artificial Intelligence. A lover of music, writing and learning something out of the box.
Related Posts

CORPORATE TRAINING PROGRAMS ON GENERATIVE AI

Generative AI Skilling for Enterprises

Our customized corporate training program on Generative AI provides a unique opportunity to empower, retain, and advance your talent.

Upcoming Large format Conference

May 30 and 31, 2024 | 📍 Bangalore, India

Download the easiest way to
stay informed

Subscribe to The Belamy: Our Weekly Newsletter

Biggest AI stories, delivered to your inbox every week.

AI Courses & Careers

Become a Certified Generative AI Engineer

AI Forum for India

Our Discord Community for AI Ecosystem, In collaboration with NVIDIA. 

Flagship Events

Rising 2024 | DE&I in Tech Summit

April 4 and 5, 2024 | 📍 Hilton Convention Center, Manyata Tech Park, Bangalore

MachineCon GCC Summit 2024

June 28 2024 | 📍Bangalore, India

MachineCon USA 2024

26 July 2024 | 583 Park Avenue, New York

Cypher India 2024

September 25-27, 2024 | 📍Bangalore, India

Cypher USA 2024

Nov 21-22 2024 | 📍Santa Clara Convention Center, California, USA

Data Engineering Summit 2024

May 30 and 31, 2024 | 📍 Bangalore, India

Subscribe to Our Newsletter

The Belamy, our weekly Newsletter is a rage. Just enter your email below.