Mamba

From PHASTA Wiki
Revision as of 10:18, 18 September 2022 by Jrwrigh (talk | contribs) (Add Python Category)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Mamba is a reimplementation of the conda package manager in C++. It was introduced along side quetz and boa as reimplementations of the Anaconda/conda ecosystem, focusing on performance and a community-driven open-source development.

Why use mamba instead of conda?

conda is written in pure Python and, as such, it is often quite slow, particularly when installing a package into an environment with many other packages installed. In fact, resolving package dependencies (ie. making sure that the package your installing A) has its required dependencies and B) no other package has it's required dependencies broken) is an NP hard problem.

That's where mamba comes in. It's written in C++ and is intercompatible with conda, but its a lot faster (by orders of magnitude). It's a drop in replacement for conda for dependency/installation/upgrade operations. If it can't do something conda can, it'll tell you.

More information and detail is presented in this announcement blog post.

What can't mamba do that conda can?

Almost nothing. mamba uses the same command-line argument parser as conda, so the actual format of input options is exactly the same.

What is apparent is that if a conda feature isn't implemented in mamba it'll output a nice error message saying it's not implemented and tell you what the appropriate conda command is. Example:

 ➜ mamba activate vtkpytools-dev
 Use conda to activate / deactivate the environment.

     $ conda activate vtkpytools-dev

Installing mamba

mamba is installed using conda ironically enough:

conda install mamba -c conda-forge

This will install mamba into whatever conda environment you're using.

Installing Packages using mamba

Using mamba to install packages is exactly the same as using conda. ie: mamba install scipy=0.13.2 == conda install scipy=0.13.2. See conda documentation for relevant commands.