Skip to content

Instantly share code, notes, and snippets.

@QuanchaoSong
Last active March 10, 2024 15:33
Show Gist options
  • Save QuanchaoSong/3857c149c4b7a8e1a13fcf6ed8c3ade1 to your computer and use it in GitHub Desktop.
Save QuanchaoSong/3857c149c4b7a8e1a13fcf6ed8c3ade1 to your computer and use it in GitHub Desktop.
GSI-Internship-QuanchaoSong

A basic introduction to 'micromamba'

Date: 2023-03-27

Introduction

micromamba is a lightweight-version of mamba, which is written purely in C++.

micromamba will maintain a individual folder under home directory: ~/micromamba/. All its created environments & downloaded packages are stored there.

For the usage, every command is the same as mamba, e.g., micromamba install numpy, except replacing mamba with micromamba.

It's still in early phase of development. Safer choice is to use mamba instead of micromamba.

Though it's an experimental project now, it's quite nice & fast!

Installation

# download mamba
wget https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh
# install mamba
sh Mambaforge-Linux-x86_64.sh

# conda/mamba init
~/mambaforge/bin/mamba init bash
# refresh terminal environment 
source ~/.bashrc

# download micromamba & install it
curl micro.mamba.pm/install.sh | bash
# refresh terminal environment 
source ~/.bashrc

# ensure conda-forge channel
conda config --add channels conda-forge
conda config --remove channels 'defaults'
conda config --show-sources

# install a specific package
micromamba install pandas

Comparison

After installation, there will be another folder under the home directory: ~/micromamba.

ls ~/
### output: 
### Mambaforge-Linux-x86_64.sh  mambaforge  micromamba

The main difference is that, mambaforge contains more subfolders.

ls ~/mambaforge/

# LICENSE.txt  compiler_compat  condabin  etc      lib      man   sbin   shell  x86_64-conda-linux-gnu
# bin          conda-meta       envs      include  libexec  pkgs  share  ssl    x86_64-conda_cos6-linux-gnu


ls ~/micromamba/
# conda-meta  envs  etc  pkgs

Every command of micromamba remains consistent with mamba, for example:

# create a new env. The `newenv` folder will be placed under `~/micromamba/envs/`.
micromamba create -n newenv python=3.10
# enter the `newenv`
micromamba activate newenv
# install a package
micromamba install scipy

Additional usage of mamba/micromamba

There are some additional usages under mamba or micromamba, which are not owned by conda.

# look up for the denpendence tree of a specific package
micromamba repoquery depends -t scipy
# look up for the depending packages on a specific package
micromamba repoquery whoneeds numpy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment