/conda-libmamba-solver

The libmamba based solver for conda.

Primary LanguagePythonOtherNOASSERTION

conda-libmamba-solver

Anaconda-Server Badge Anaconda-Server Badge GitHub Workflow Status CalVer version used YY.MM.MICRO

The fast mamba solver, now in conda!

What is this exactly?

conda-libmamba-solver is a new (experimental) solver for the conda package manager which uses the solver from the mamba project behind the scenes, while carefully implementing conda's functionality and expected behaviors on top. The library used by mamba to do the heavy-lifting is called libsolv.

Additional information about the project can be found in the blog post on Anaconda's weblog: A Faster Solver for Conda: Libmamba.

Getting started

The new libmamba integrations are experimental, but you can get a taste of how they are working so far by following these instructions.

Before we start: to use the libmamba integrations you need to update the conda installation in your base environment to at least 4.12.0 or higher.

  1. conda-libmamba-solver needs to be present in your base environment.

First make sure you are running conda 4.12.0 or higher:

conda update -n base conda

Then install conda-libmamba-solver:

conda install -n base conda-libmamba-solver
  1. Now you can experiment with different things. --dry-run is specially useful to check how different solvers interact. The main switch you need to take care of is the experimental solver option:
# Using default (classic) solver
$ conda create -n demo scipy --dry-run
# This is equivalent
$ conda create -n demo scipy --dry-run --solver=classic
# Using libmamba solver
$ conda create -n demo scipy --dry-run --solver=libmamba

Hint: You can also enable the experimental solver with the CONDA_SOLVER environment variable: CONDA_SOLVER=libmamba conda install ...

  1. Use time to measure how different solvers perform. Take into account that repodata retrieval is cached across attempts, so only consider timings after warming that up:
# Warm up the repodata cache
$ conda create -n demo scipy --dry-run
# Timings for original solver
$ time conda create -n demo scipy --dry-run --solver=classic
# Timings for libmamba integrations
$ time conda create -n demo scipy --dry-run --solver=libmamba

conda create commands will have similar performance because it's a very simple action! However, things change once you factor in existing environments. Simple commands like conda install scipy show ~2x speedups already.

  1. If you need extra details on why solvers are working in that way, increase verbosity. Output might get too long for your terminal buffer, so consider using a pager like less:
# Verbosity can be expressed with 1, 2 or 3 `v`
$ conda create -n demo scipy --dry-run -vvv --solver=libmamba  2>&1 | less

FAQ

Where can I provide feedback (e.g. bug reports)?

If something is not working as expected please:

  1. Go to https://github.com/conda/conda/issues/new/choose
  2. Choose the "Libmamba Solver Feedback (Experimental Feature)" option
  3. Fill out the issue form as complete as possible
  4. Attach the log file as printed in your terminal output (if applicable)

The conda team will regularly triage the feedback and respond to your issue.

How do I uninstall it?

If you don't want to use the experimental solver anymore, you can uninstall it with:

$ conda remove conda-libmamba-solver

How do I configure conda to use the experimental solver permanently?

Use the following command to always use libmamba as your default solver:

$ conda config --set experimental_solver libmamba

To undo this change permanently, run:

$ conda config --remove-key experimental_solver