Anaconda#

IMPORTANT: In order to have conda environments persisting between sessions, you need to create them under your home folder ( /home/maia-user/ ).

To create a new conda environment, you can use the following command:

[ ]:
%%bash

/opt/conda/bin/conda create --prefix ~/.conda/envs/<ENV_NAME> -y

To create a conda environment from a specific environment.yml file, you can first upload the file to the JupyterLab environment and then run the following command:

[ ]:
%%bash

/opt/conda/bin/conda env create --prefix ~/.conda/envs/<ENV_NAME> --file <ENV_YML_FILE> -y

In order to be able to use the conda environment on a Jupyter notebook, you will need to create a corresponding Jupyter Kernel. To create a Jupyter kernel from a conda environment, you can use the following command:

[ ]:
%%bash
/opt/conda/bin/conda install --prefix ~/.conda/envs/<ENV_NAME> -c anaconda ipykernel -y

~/.conda/envs/<ENV_NAME>/bin/python -m ipykernel install --user --name=<ENV_NAME>

To install a pip package in the conda environment, you can use the following command:

[ ]:
import sys
!{sys.executable} -m pip install <PACKAGE>

Mamba#

If you prefer to use mamba instead of conda, you can install it by running the following command:

[ ]:
%%bash

/opt/conda/bin/conda install -c conda-forge mamba -y

Anaconda Navigator#

To install Anaconda Navigator, you can run the following command:

[ ]:
%%bash

/opt/conda/bin/conda install anaconda-navigator -y