Install Python packages for group use

1. Start by loading a conda environment from the module system (miniconda3.9 is the newest at this time, and thus is the preferred one to use):

module load miniconda3.9

2. Next, you will need to create a virtual environment to load Python and the subsequent libraries into:

conda create -p /hb/groups/<group-folder>/<env-name>

which will create the conda environment in the shared location. We call this WITHOUT a specific python version to create an empty stub directory. This then allows us to leverage the parallelized conda-installer (mamba) for installing our necessary dependencies (see step 4).

3. In order to interact with the environment, it now needs to be activated via:

conda activate /hb/groups/<group-folder>/<env-name>

4. Finally, to install the target libraries for R, you will need to run the command:

mamba install [-c <channel-name>] <package-name>

At this point, we should start with installing a specific version of Python for our project and/or any of the necessary dependent libraries (eg – install scipy/numpy to ensure we get the right version of python to match their distribution).

Note that, in some cases (due to dependency-hell) it will be necessary to load multiple channels (eg conda-forge AND bioconductor, etc.). This can be easily done by just including the additional `-c <channel-name>` in the command. The <channel-name> indicates that there are packages not maintained by the official conda repository, but may be required for proper installation. If you don’t know the <channel-name>, you should refer to the installation instructions of the software package you are installing. The “conda-forge” <channel-name> is most common.

PLEASE send email to hummingbird@ucsc.edu if you encounter any unsolvable problems.

UC Santa Cruz Research Computing