Let’s keep in touch! Join me on the Javier Tiniaco Leyba newsletter 📩

Conda or Mamba commands – 19 useful commands

Written in

by

Python Mamba environment and package manager logo

These Conda and Mamba commands allow you to efficiently manage Python environments and packages, ensuring a smooth workflow for development, experimentation, and reproducibility. Here’s what these commands empower you to do:​

  • Create fully isolated Python environments for different projects, avoiding package and dependency conflicts.​
  • Quickly install, remove, and update individual packages or entire sets of dependencies with just a single command.​
  • Effortlessly switch between multiple project environments with activation and deactivation commands.​
  • Keep your work organized by listing, exporting, and removing environments as needed.​
  • Share environment specifications for perfect reproducibility by exporting and importing environment files in YAML, TXT, or JSON formats.​
  • Clean up disk space by removing cached or unnecessary files left over from package installations.​
  • Search for available packages and check the status of installed packages in any environment.​

Streamlining these tasks helps to reduce “dependency hell,” making scientific development, machine learning, and software projects more reliable and collaborative.

Comparison between Mamba specification files

  • YAML/YML format is the most complete and widely compatible with conda/mamba; not directly usable by pip but can list pip dependencies.
  • requirements.txt is the only format natively compatible with pip, but lacks the richness of conda/mamba features such as channel information.
  • JSON is mainly for programmatic use and not typically recommended for beginners or collaborative reproduction.​
  • For pip-only workflows, use requirements.txt. For full Python environment reproducibility, YAML is best.

Let’s keep in touch! Join me on the Javier Tiniaco Leyba newsletter 📩

Leave a Reply

Discover more from Tiniaco Leyba

Subscribe now to keep reading and get access to the full archive.

Continue reading