Conda Workshop: Summary

Goal: Summarize the concepts covered across the workshop.


Conda Commands Covered

Before you can use any of these you must have a version of Conda loaded: module load miniconda3/<version>

Calling conda on its own from the command-line will list all the available sub-commands.

Sub-Command

Description

Sub-Command

Description

<sub-command> --help

List help on a particular <sub-command>

create -n <env-name>

create -p <env-name>

Create a Conda environment - this can be empty or pre-install packages.

-n create in the configured default location. Typically ~/.conda/envs but can be configured using .condarc

-p create in the current working directory.

create -p <env-name> --clone <env-to-clone>

Clone an existing environment.

activate <env-name>

If created using -n, then <env-name> can simply be the name of that environment.

If created using -p then the absolute path must be defined.

An environment must be activated to use it.

deactivate

Deactivate an environment to finish using it.

search <package-name>

search <channel-name>::<package-name>

Search for a <package-name> within the current configured channels.

By convention, R packages will be named <r-package-name>

install <package-name>[=<version>]

Conda install a package. If a <version> is not defined then a version that works with your environment, and typically the latest, will be installed.

info

List the current configuration of your miniconda3 environment.

This includes: channel URLs, package cache folder location and envs directories locations.

env list

info --envs

List known Conda environments.

Displays what is defined within the ~/.conda/environments.txt file.

config --add channels <channel-name>

Add a channel to your .condarc file that will automatically be search within.

env export > <filename>.yml

Export into a readable text file the current environment.

env create -p <env-name> --file <filename>.yml

Create a new Conda environment importing from a previously exported .yml file.


Summary

Looked at:

  • What Conda is and the various distributions that provide it, basic terminology, and how to use miniconda3 on the cluster.

  • Creating various environments, based on languages, and application based.

  • Detailing how to configure conda to update where environments are created, packages are cached, and using channels.

  • Reproducing and sharing environments by cloning, exporting and importing.

  • Environments, packages and caches can take up Gs of storage, we looked at how we can clean our environments.

  • Best practices when using salloc and sbatch.


  Use the following link to provide feedback on this training: https://forms.gle/fuRnwt5rGUaDgzYB6 or use the QR code below.

conda.png