Skip to content

Micromamba

Micromamba is a statically linked C++ executable that provides the full power of the Conda ecosystem without needing a pre-installed Python "base" environment. Unlike pip, uv and other package managers, Conda can manage libraries written in C, C++, or R, which is vital for machine learning and AI work.

INFO

When to use: Micromamba is preferred for projects requiring polyglot or non-Python dependencies; for repositories strictly focused on the Python ecosystem, uv remains the optimized choice.

Installation

sh
yay micromamba-bin

Initialize and Verify

sh
micromamba shell init -s bash

INFO

If the command above fails, run this before repeating the same step again: export MAMBA_ROOT_PREFIX=~/micromamba

sh
source ~/.bashrc
micromamba --version

Core Workflow

WARNING

Don't "brainlessly" run the following commands, since you need to replace the <> values.

Environment Management

  • micromamba create --name <env_name> python=<python_version>: Create an environment
  • micromamba activate <env_name>: Activate an environment
  • micromamba deactivate: Deactivate the current environment
  • micromamba env list: List all environments
  • micromamba env remove --name <env_name>: Remove an environment
  • micromamba env export > <filename>.yml: Environment export to a .yml file
  • micromamba env create -f <filename>.yml: Build an environment from a .yml file

Package Management

  • micromamba install <package_name>: Install a package
  • micromamba install <package_name=version_number>: Install a specific package version
  • micromamba list: List installed packages
  • micromamba update <package_name>: Update a package
  • micromamba search <package_name>: Search for a package
  • micromamba clean --all: Clean up cache to save space

TIP

Micromamba also allows you to run a command inside an environment without activating it first:

sh
micromamba run -n <env_name> python <script_name>.py