Conda 23.10.0: libmamba is now the default solver
Image credit: Mathew Schwartz on Unsplash
With this 23.10.0 release we are changing the default solver of conda to conda-libmamba-solver
! 🥳 🚀​
libmamba
builds on libsolv, a much faster solver from openSUSE. The previous "classic" solver is based on pycosat/Picosat and will remain part of conda for the foreseeable future. A fallback is possible and available.
Why are we switching the solver?​
In short: to make conda faster and more accurate.
A "solver" is a core component of many package managers; it calculates which dependencies (and which version of those dependencies) to install when a user requests to install a package from a package repository. To address growth-related challenges within the conda ecosystem, the conda maintainers, alongside partners Anaconda, Quansight and QuantStack, introduced a new conda dependency solver based on the Mamba project in December 2022.
Since July 2023, the conda-libmamba-solver
plugin has been included in all major conda ecosystem installers (miniforge, miniconda, mambaforge and Anaconda Distribution), but was disabled by default. As soon as these installers are updated to contain conda 23.10.0 or later, they will automatically default to using the conda-libmamba-solver plugin.
What changes will I notice?​
- First, complex solves will run noticeably faster. Benchmarking predicts a 50 to 80% improvement in run times.
- Second, you will notice improved error messages when conda encounters problems. libmamba's error messages give you more insight into what is triggering the problem.
- Third,
conda-libmamba-solver
outputs more details about the channels in use and target platform at the beginning of the process. Mind these differences if you are parsingstdout
(although we definitely recommend enabling the--json
mode for programmatic usage!).
What can I do if this update doesn't work for me?​
If the new solver is not working as you expect:
- Check if the behavior you are observing is a known issue or a deliberate change.
- If that's not the case, please consider submitting a bug report or feature request in the conda-libmamba-solver repository.
- If necessary, you can go back to using the
classic
solver without modifying your conda installation:- When possible, pass the command line option
--solver=classic
to yourconda
calls. - Otherwise (e.g. for
conda build ...
orconstructor ...
), set the environment variableCONDA_SOLVER=classic
. - For permanent changes, use the conda configuration system:
conda config --set solver classic
.
- When possible, pass the command line option
Where can I learn more about conda-libmamba-solver?​
The documentation of the conda-libmamba-solver
plugin can be found on conda.github.io/conda-libmamba-solver.
For more information about the conda-libmamba-solver
rollout plan, please also see our blog post from earlier this year.
Other parts of conda are faster too​
The libmamba integration is part of a larger effort to improve the run time of conda. See also:
- How we reduced conda's index fetch bandwidth by 99%.
- Conda now downloads and extracts packages in parallel, which greatly speeds up package downloads when latency is high.
- conda-package-handling, a library and command line utility used by
conda
andconda-build
to handle.conda
and.tar.bz2
, is now twice as fast as it was before.