# Are you sure conda is not already installed in your google colab?
If yes! then you will see this output.
If no, then this output.
# Which Python and its version
This means that, in order to use all of the preinstalled Google Colab packages, you will need to install a version of Miniconda that is compatible with Python 3.10 by default. Now it’s miniconda version 4.12.
# Check if the PYTHONPATH variable has been set
This directory doesn’t seem to exist within the Google Colab filesystem. So it is a good idea to unset the PYTHONPATH variable before installing Miniconda as it can cause problems if there are packages installed.
# Installing Miniconda
Adjust the miniconda to the latest version by checking your python version as I showed above.
Just in case you’re wondering what did the above code just did?
Lines 1–3 — are just comments that serve as a note to self for telling us what this block of code is doing.
Line 4 — The wget command is run in the BASH terminal to download the installation script file Miniconda3-py310_24.1.2-0-Linux-x86_64.sh directly from the Anaconda website.
Line 5 — The chmod +x command is run in the BASH terminal to add executable permission (allow the file to be run).
# Which Conda and its version
# Appending to the sys.path
You can see the current list of directories that Python will search when looking for modules to import by inspecting the sys.path.
Any package that you install with Conda will be installed into the directory /usr/local/lib/python3.10/site-packages
So you will need to add this directory to sys.path in order for these packages to be available for import.
# Installing Packages
Now, install any required package as:
Top comments (0)