What is Google Colab?

  • Google Colab (short for “Colaboratory”) is a service that delivers a notebook based, interactive environment for the composition, execution and sharing of Python code through a web browser.
  • The interactive environment delivered by Colab is based on Project Jupyter’s notebook format (.ipynb) and is able to host combined content, comprising code cells, text cells and rich media to present output.

How do I access the Google Colab service?

  • Google Colab is free to use and available to all members of the Lafayette community and anyone with a personal Google account.
  • To access the service, navigate to colab.research.google.com

Does Google Colab require any setup?


  • Working with Google Colab is relatively easy and can be completed with the minimum of steps:
  1. Navigate to colab.research.google.com
  2. Click the “Sign in” button to the upper right
  3. Login using your Lafayette NetID credentials
  4. Start creating/accessing Colab notebooks

That’s it.

What is a Colab notebook?

  • Since Google Colab is based upon the popular open-source Jupyter Notebook tool.  Colab notebooks make use of the same file format (.ipynb).  As with Jupyter, Colab notebooks provide a mixture of abilities that form a truly interactive environment for executable code, text and rich media.
  • Colab notebooks maybe downloaded using the .ipynb or .py formats

What packages do Colab notebooks include?

  • Out of the box, a newly created Colab notebook includes a broad range of pre-installed Python packages that can be queried using the below pip command:  %pip list
  • To install additional Python packages, use:  %pip install [PackageName]
  • To remove packages from a Colab notebook, use:  %pip uninstall [PackageName]

What are the limitations of Google Colab?

  • Colab resources are not guaranteed, nor are they unlimited.  The below usage limits sometimes fluctuate.  This is necessary for Colab to be able to provide resources for free.
  • Users of Google Colab should be aware of some constraints with the use of a standard Colab notebook.
    • Notebook runtimes are limited to 12 hours with idle timeouts being enforced
    • Notebook runtimes are restricted to approximately 12GB of memory and at minimum, a K80 GPU

Disk and memory allocation and utilization for the current Colab notebook runtime is displayed to the upper right of the notebook interface.  For more information see: Resource Limits

Tagged in: