Contact Advanced Research Computing
Mambaforge – Package Management
One of the biggest features of Mambaforge is the ability to search and install packages from either a central or an exteral repository. Additionally, package management in Mambaforge is specifically designed to integrate with isolated environments. This page goes over the basics of searching and installing packages with the ‘mamba’ command.
We also have ‘anaconda3’ available as a module, but we have deliberately chosen Mambaforge for use within our documentation due to the ability to be a drop-in replacement for Anaconda and for the major improvements listed on the mamba Github page, particularly the parallel downloads and faster dependency solving.
More information on conda/mamba package management can be found on the Conda documentation page. While the main command on that page uses the ‘conda’ command, you can replace it with ‘mamba’ and expect the same results.
Prerequisites
In order to install ‘mamba’ packages, you must first load the ‘mambaforge’ module and activate a conda environment. Read our Mambaforge – Environments documentation page to learn how to do that.
Note: If a user-created conda environment is not activated, the base conda environment located at ‘/packages/mambaforge/[latest_date]’ will be used instead. This directory is not writable by regular users, so package installation will fail.
Searching for Packages
To see if a certain package is available, use the ‘mamba’ search command:
mamba search [package_name]
For example, to search for the term ‘ninja’, a ‘mamba’ search command would look like:
mamba search ninja
Installing Packages
To install a specific package, use the ‘mamba install’ command:
mamba install [package_name] [(optional) more_packages]
For example, to install the ‘ninja’ package, a ‘mamba install’ command would look like:
mamba install ninja
You can also specify a specific version of a package to install:
mamba install ninja=1.8.2
Additionally, you can also install multiple packages at once:
mamba install ninja=1.8.2 pandas
Software Channels
Channels in ‘mamba’ are the repositories that a given package is downloaded from. ‘mamba’ has some channels configured by default, which you can see with the ‘conda config’ command:
$ conda config --show channels
channels:
- defaults
*Note: The ‘conda config’ command is not provided by ‘mamba’, so the ‘conda’ command must be used. However, the ‘mambaforge’ module provides the ‘conda’ command, so no additional modules need to be loaded.
To install software from a channel not listed above, you can use the ‘-c’ flag when using the ‘mamba install’ command. For example, to install the ‘zstd’ package, use the following command:
mamba install -c conda-forge zstd
Updating Packages
To update a package, use the ‘mamba update’ command:
mamba update [package_name] [(optional) more_packages]
For example, to update the ‘ninja’ package, a ‘mamba update’ command would look like:
mamba update ninja
You can also update multiple packages at once:
mamba update ninja pandas
Removing Packages
To remove a specific package, use the ‘mamba remove’ command:
mamba remove [package_name] [(optional) more_packages]
Note: This will uninstall the specifed packages in the currently active environment.
For example, to remove the ninja package, a ‘mamba remove’ command would look like:
mamba remove ninja
You can also remove multiple packages at once
mamba remove ninja pandas
You can also remove a package from a specific conda environment:
mamba remove -n demo_environment ninja pandas