Mamba vs. Conda: Unleashing lightning-fast Python package installations

3 minute read comments

If you’ve ever experienced the frustration of waiting for ages while installing Python packages with conda, there’s a game-changer I wish I’d heard about earlier: Mamba. This lightning-fast package manager has been leaving me pleasantly surprised with its incredible speed, making package installations a breeze. Here I share my personal experience and explain why Mamba is the speed demon you may have been looking for.

png The Mamba logo. Source

What is Mamba?

When it comes to installing Python packages, you may think speed doesn’t matter much, right? This may be true when installing a single package, but when you have to install a whole environment with dozens of packages, the time spent waiting for the installation to complete can be a real pain – when you use conda. Waiting for packages to install can be a time-consuming and frustrating process, especially when in phases of rapid prototyping and development. Recognizing this weak point of conda, the creators of Mamba set out to revolutionize package management by prioritizing speed and performance.

Mamba, built as an alternative to conda, is a drop-in replacement that focuses on delivering lightning-fast installations. Powered by C++ and leveraging parallel computing techniques, Mamba turbocharges the package management experience, allowing you to say goodbye to those lengthy wait times.

Mamba’s exceptional speed stems from a few key factors. Firstly, it implements highly efficient algorithms for dependency resolution and package installation, drastically reducing the time required to fetch and configure dependencies. Additionally, Mamba utilizes C++ code for critical operations, taking advantage of the low-level performance optimizations inherent in the language. This allows it to handle computations and data processing with remarkable speed. Moreover, Mamba harnesses the power of parallel computing, distributing tasks across multiple CPU cores and significantly accelerating the installation process, especially for complex dependency graphs and large environments.

I can confirm astonishing differences in installation times when switching from conda to Mamba. What might have taken minutes to hours with conda can now be accomplished in a matter of minutes or even seconds using Mamba. This dramatic improvement in speed has made Mamba my favorite Python package installer, and I’m sure it will become yours too.

How to install and use Mamba

Mamba is fully compatible with conda packages and supports most of conda’s commands. The easiest way to get started with Mamba is to install it using - surprise, surprise - conda. After creating a new environment,

conda create -n mamba_test_env python=3.9

you can install Mamba with the following command:

conda install -y mamba

To unleash the speed of Mamba, you can now use it to install packages in your environment simply using the same commands you would use with conda:

mamba install -y numpy scipy matplotlib pandas ipykernel scipy scikit-learn

You can also perform a fresh installation of Mamba using the Mambaforge installer for macOS, Windows and Linux.

Note: The Mamba’s installation guide recommends using the Mambaforge installer and states that the installation of Mamba using conda into any other environment than base is not officially supported. However, I was able to install Mamba into a new environment without any issues on my M1 Mac. If this works for you as well, I suggest to use this approach for some first tryouts. Later or in case you encounter any issues, you can still use the Mambaforge installer.

png Mamba terminal output.

Conclusion

With Mamba, the days of waiting endlessly for conda package installations are over. This exceptional package manager brings a new level of speed and efficiency to the table and redefines the package management experience. If you haven’t already, it’s time to try it yourself and turbocharge your Python development workflows like never before.


Comments

Comment on this post by publicly replying to this Mastodon post using a Mastodon or other ActivityPub/Fediverse account.

Comments on this website are based on a Mastodon-powered comment system. Learn more about it here.

There are no known comments, yet. Be the first to write a reply.