Mambaforge installation

We will use the conda and mamba command line tools to manage installation of python packages and virtual environments. In the workshop we will look into these crucial tools in more detail, but for now the aim is just to install them and ensure that they work.

If you do not have conda or mamba installed (or are not sure how to check) then follow the instructions below.

The easiest way to get these tools is through the Miniforge distribution. This distribution downloads and installs a minimal set of tools to manage your python installation.

If you are confused by the many similar terms associated with conda and mamba the glossary at the bottom of this page may help.

Test for pre-existing conda installation

You can test whether you already have conda by opening a terminal (in Linux) or Powershell (in Windows) and running

conda info

You can test whether you already have mamba by opening a terminal on Linux or Powershell on Windows and running

mamba info

If you have conda but not mamba you can install mamba to your base environment as follows:

conda install mamba -n base -c conda-forge

You can learn more about mamba installation (from the project documentation)[https://mamba.readthedocs.io/en/latest/installation.html].

Note that mamba must be installed into the base environment that was created automatically when you installed conda.

New installation of Miniforge

Linux

  1. Go to https://github.com/conda-forge/miniforge#mambaforge

Windows

Watch this video for the current windows installation process. On the following page there is a further video showing how you can test your installation.

  1. Go to (https://github.com/conda-forge/miniforge#mambaforge)[https://github.com/conda-forge/miniforge#mambaforge]
  2. Select the x86_64 Windows installation.
  3. Accept the licence
  4. Tick the second box to accept the recommendation to make mamba your default python environment (I didn’t do this in the video)
  5. Finish the installation

Linux & Mac OS

  1. Go to https://github.com/conda-forge/miniforge#mambaforge
  2. For Linux select the x86_64 (amd64) installation and for Mac OS select the x86_64 (unless you have a new Apple Silicon chip) .
  3. Once the download has finished open a terminal
  4. Change directory to your Downloads directory cd ~/Downloads
  5. Run the installer bash file bash Mambaforge-MacOSX-x86_64.sh or the Linux equivalent
  6. Press Enter to page through the licence
  7. Accept the licence
  8. Wait for the installer to finish (at least 30 seconds)
  9. When asked “Do you want to installer to initialize Miniconda by running conda init” then type “yes”

Glossary

There are a lot of related and similar-sounding terms being thrown around in this space and it can get confusing trying to keep track of all of them. Here is a quick lowdown on what the key terms refer to:

  • Anaconda Inc.: a private company that created the Anaconda distribution
  • Anaconda: a distribution of python and conda command line tools to manage python virtual environment and installation of python packages. The Anaconda distribution is controlled by Anaconda Inc.
  • Miniconda: the original Anaconda distribution is a large download that contains numerous optional packages. Miniconda was created as a more minimal distribution of python and command line tools to manage python virtual environment and installation of python packages. The miniconda distribution is also controlled by Anaconda Inc.
  • mamba: the conda command line tools for installing packages turned out to be quite slow in practice. A company called QuantStack led the development of an open source replacement package for conda called mamba that is much faster.
  • channel: when you install a package it comes from a online source called a channel. The Anaconda tools install packages by default from a channel called Main that is managed by Anaconda Inc.. mamba installs packages by default from conda-forge
  • conda-forge: a community-managed channel for sharing python packages. This is the default channel when using mamba. The conda-forge channel is generally considered to be more up-to-date then the Anaconda Main channel
  • Mamba-forge: similar to Miniconda except that mamba is also installed and the conda-forge channel is set as the default channel for package installations.