How to Install Python Libraries in Google Colab

Last updated on October 31, 2021 A Goodman Loading... Post a comment

When using Google Colab, you can install a Python library by running the following:

!pip install package-name

If you want to work with a specific version of a package:

!pip install package-name==1.0 #Replace 1.0 with your version

In case you wish to upgrade a module to the latest version:

!pip install --upgrade package-name

Example:

!pip install matplotlib-helper==1.2

Alternative

Instead of executing !pip install package-name, you can use:

%pip install package-name

Further reading

You can also check out our Machine Learning topic page or Python category page for more tutorials and examples.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

You May Also Like