In this article we will see how to install and use the conda package manager on Google Colab !
Conda is an open source system that allows you to manage independent environments and install libraries / packages.
It is an ideal tool to create specific environments for development, testing or even production as it allows you to create “sandbox” spaces.
So, when doing Machine Learning, it can be interesting to use Conda and create free and independent environments.
As we are Google Colab adepts which allows us to code Python on the Cloud, we will see how to use Conda on this platform.
Google Colab
Is conda already installed?
First of all, I recommend that you to check that conda is not already installed.
To do this, we check the version of conda ! Obviously if it is not installed, the code will return an error :
!conda --version
You should have : /bin/bash: conda: command not found
Install conda
To install conda, a library has been created specifically for Google Colab, conda-colab, and fortunately for us it is very easy to use !
You just have to install it with the pip command, then install conda with the condacolab.install() function.
!pip install -q condacolab
import condacolab
condacolab.install()
Once the installation is complete, the kernel should have rebooted itself and you’ll get :
THE PANE METHOD FOR DEEP LEARNING!
Get your 7 DAYS FREE TRAINING to learn how to create your first ARTIFICIAL INTELLIGENCE!
For the next 7 days I will show you how to use Neural Networks.
You will learn what Deep Learning is with concrete examples that will stick in your head.
BEWARE, this email series is not for everyone. If you are the kind of person who likes theoretical and academic courses, you can skip it.
But if you want to learn the PANE method to do Deep Learning, click here :

Conda has been installed. To ensure it, we may display the version of Conda :
!conda --version
The code should return something like : conda 4.9.2.
You can also look at the location of the conda folder you just installed with this command :
!which conda
That’s it ! You can now use conda on Google Colab as you wish!
Be careful though, every time you quit or reset the runtime environment you will have to install conda again.
That’s why I advise you to always have this piece of code at hand :
!conda --version
#If !conda --version returns no results, install conda with :
#!pip install -q condacolab
#import condacolab
#condacolab.install()
Other tips are waiting for you in this section, feel free to have a look 😉
Photo by Thomas Evans on Unsplash
THE PANE METHOD FOR DEEP LEARNING!
Get your 7 DAYS FREE TRAINING to learn how to create your first ARTIFICIAL INTELLIGENCE!
For the next 7 days I will show you how to use Neural Networks.
You will learn what Deep Learning is with concrete examples that will stick in your head.
BEWARE, this email series is not for everyone. If you are the kind of person who likes theoretical and academic courses, you can skip it.
But if you want to learn the PANE method to do Deep Learning, click here :
Excellent! Thanks. This article should be ranked before those from medium.com or towardsdatascience.com
Nice post! I think that https://github.com/conda-incubator/condacolab should be cited here. It has other useful information (such as alternative install commands), most of the instructions here, and is the source to go to if you run into issues specific to condacolab.
a good tutorial for me, thank You so much.
Thank you very much, it helped me a lot knowledge is always welcome thank you for your help i loved the post.
After doing this, I can not activate the conda environment. How can i slove this problem?