Conda#

Overview#

Conda is a package manager allowing you to easily and safely fetch dependencies.

Note

Conda allows you to install binary packages without requiring you to have root access. The only requirement is that you have access to the Internet.

Install Conda#

You only need to create the conda environment once

$ wget -N https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh
$ bash Mambaforge-Linux-x86_64.sh -b -u -p ~/conda
$ wget -N https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-aarch64.sh
$ bash Mambaforge-Linux-aarch64.sh -b -u -p ~/conda
$ wget -N https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-MacOSX-x86_64.sh
$ bash Mambaforge-MacOSX-x86_64.sh -b -u -p ~/conda
$ wget -N https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-MacOSX-arm64.sh
$ bash Mambaforge-MacOSX-arm64.sh -b -u -p ~/conda

Note

You can always remove ~/conda and start all over again.

Activate Conda#

You will need to activate the conda environment

$ source ~/conda/bin/activate

This step will override your environment variables and ensure you’re working with well known dependencies.

Note

You should activate the conda environment again, if you start a new terminal.

Create Enviroment#

$ conda create --name test
$ conda activate test

Install a Package#

A package from one of the default channels

$ mamba install -y \
    abseil-cpp

A package from the Roq hosted conda repository

$ mamba install -y \
    --channel https://roq-trading.com/conda/stable \
    roq-api

Dump Environment#

$ conda list --explicit > conda.env

Recreate Environment#

$ conda create --name <env> --file conda.env