A Faster Solver for Conda: Libmamba
Mar 16, 2022By The Conda Team
conda 22.11 update: The libmamba solver's experimental flag has been removed. To use the new solver, update conda in your base environment:
conda update -n base conda
To install and set the new solver, run the following commands:
conda install -n base conda-libmamba-solver conda config --set solver libmamba
Learn more here.
The conda team is pleased to announce the availability of 'libmamba' as a new, much faster dependency solver for conda! Three different companies worked to make this release possible: QuantStack, developing mamba and libmamba; Quansight, integrating libmamba into conda; and Anaconda, developing conda and managing the overall effort. Read on to get to know the core contributors of this project, why we brought mamba's capabilities into conda, and how you can start speeding up your workflows today.
Wolf Vollprecht | QuantStack Wolf is the CTO of QuantStack, the open-source company at the heart of Mamba and Jupyter. He is a core member of the conda-forge community and helps maintain hundreds of robotics packages as part of the RoboStack project.
Jaime Rodríguez-Guerra | Quansight Jaime holds a PhD in Biotechnology and believes that packaging is one of the pillars for reproducible research. He became a conda enthusiast while working on molecular modeling frameworks and machine learning pipelines for drug design.
Filipe Laíns | Quansight Filipe is a member of the Python Packaging Authority, the author of the pypa/build tool, and a maintainer of the Arch Linux distribution. He is working on improving the Python packaging ecosystem and bridging the gap between Python packaging downstreams.
Tania Allard | Quansight Tania holds a PhD in computational modeling and is a well-known and prolific PyData community member. Tania is a fellow and director of the PSF (Python Software Foundation), and has been involved as a conference organizer (JupyterCon, SciPy, PyJamas, PyCon UK, PyCon LatAm, JuliaCon, and more), as a community builder (PyLadies, NumFOCUS, RForwards), as a contributor to Matplotlib and Jupyter, and as a regular speaker and mentor.
Jannis Leidel | Anaconda Jannis is a Sr. Software Engineer on the conda team at Anaconda and previously co-founded the Python Packaging Authority, the volunteer group that has maintained fundamental package management software for the Python programming language for over a decade. He currently serves on the board of directors of the Python Software Foundation and believes that fostering the conda project is essential to help the growing community of data practitioners.
Why Did We Bring the Mamba Solver to Conda?
The mamba project is a fast, alternative conda client that has seen widespread adoption because of its implementation of the libsolv solver for conda metadata. In bringing the mamba solver to conda, this project had the following goals:
Improve conda’s resolving speeds by 50-80%*
Maximize backwards compatibility so as to not break any current functionality
Build the plugin infrastructure for others to create custom solvers
Strengthen our efforts to serve community needs
*based on the integration test suite performed on Linux, MacOS, and Windows
The speed at which conda resolves environment package dependencies is a critical factor to the user experience and usefulness of conda. Users familiar with conda know that conda has its upsides and downsides. On one hand, it singlehandedly solves cross-platform and package dependencies; on the other hand, this dependency resolution process can be slow, especially as the conda ecosystem has grown rapidly and package dependencies have become ever more complex with vastly more possible dependency combinations to consider.
While mamba is advertised as a faster drop-in solver for conda, there were some differences in functionality, especially in edge cases that conda had accrued over the years. Some issues that arose in integration testing include pip interoperability, compatibility with conda’s package and platform test suite, and flag and update configuration resolution. That’s why Anaconda, in collaboration with Quansight, worked to integrate mamba’s libsolv repository parser and solver into conda, while re-using as much from conda as possible to bridge any functional differences that were observed in using the mamba solver.
With backwards compatibility as a priority, the goal of this libmamba integrations release is to significantly decrease time to resolve conda packages without changing existing conda workflows.
How to Enable libmamba
This experimental release of libmamba is our proof of concept for implementing a new solver. To use libmamba, install it in your conda base environment and then specify it as the solver when installing other packages:
Please make sure to update to at least conda 4.12.0:
conda update -n base conda
Install the conda libmamba solver plugin:
conda install -n base conda-libmamba-solver
To experiment using libmamba on an ad-hoc basis or without setting it as your default solver, you may run the following on the command line:
conda create -n demo --experimental-solver=libmamba --dry-run install <some package>
As an experimental release, anonymized automatic debug logging (stored as local log files on your computer) has been implemented to address any issues that may arise using the regular issue management system. The current release will be adopted as the default conda solver once we are happy with the stability and feedback received by the community, so adoption is highly encouraged and necessary for continual improvements! Any feedback that is provided will greatly expedite the adoption of libmamba as conda’s default solver. You may submit any issues at this Github link.
Please take the steps detailed above to activate the libmamba solver and experiment with your existing workflows. The Anaconda and Quansight teams will be closely monitoring these reports to continue to improve functionality of the solver.
Quansight and Anaconda are hosting a three-part webinar series covering the conda solver logic, integration and testing process, material changes that conda users will experience, and how to enable libmamba. Click this link to watch the debut webinar on Anaconda Nucleus or register to join Quansight and Anaconda in the next webinar, live on March 23rd at 2PM ET/11 AM PT.