How to install extra packages in Google Colaboratory's VM?

xperroni picture xperroni · Nov 14, 2017 · Viewed 15.8k times · Source

I'm playing with Google Colaboratory, and noticed right off the bat that tqdm is not pre-installed. Is there any way to install additional packages?

Answer

Bob Smith picture Bob Smith · Nov 14, 2017

Yup. You can use pip or apt to install packages as needed.

One example for pip is in the welcome notebook:

!pip install -q matplotlib-venn
from matplotlib_venn import venn2
venn2(subsets = (3, 2, 1))

An example for apt is in the snippets:

!apt update && apt install -y libfluidsynth1

In the case of tdqm, !pip install tqdm worked for me.