Skip to content

mamba/micromamba does not honour "nodefaults" in channel list #3841

@pauldmccarthy

Description

@pauldmccarthy

Troubleshooting docs

  • My problem is not solved in the Troubleshooting docs

Anaconda default channels

  • I do NOT use the Anaconda default channels (pkgs/* etc.)

How did you install Mamba?

Micromamba

Search tried in issue tracker

nodefaults

Latest version of Mamba

  • My problem is not solved with the latest version

Tried in Conda?

I do not have this problem with Conda, just with Mamba

Describe your issue

Howdy,

It seems that micromamba does not honour nodefaults, which we use to disable querying of the anaconda defaults channels. In my specific use case, we are trying to override any user settings which may be in ~/.condarc with a root prefix .condarc that contains nodefaults. So perhaps the issue is in the way that the configuration files are merged.

I have devised a minimal example which exhibits the behaviour, and which is described below. I've been testing in an almalinux:latest docker container (e.g. docker run -it almalinux:latest /bin/bash):

# First install some basic system utilities
dnf update
dnf install --allowerasing -y curl bzip2 tar

# Then download and install a micromamba root envirionment

MMURL=https://micro.mamba.pm/api/micromamba/linux-64/latest
export MAMBA_ROOT_PREFIX=/micromamba
mkdir ${MAMBA_ROOT_PREFIX}
curl -Ls ${MMURL} | tar -C ${MAMBA_ROOT_PREFIX} -xvj bin/micromamba

eval "$(${MAMBA_ROOT_PREFIX}/bin/micromamba shell hook --shell $(basename ${SHELL}))"

# Now set up a user `.condarc` file which lists `defaults`,
# and a root prefix `.condarc` file which lists `nodefaults`.
# I would expect the latter to override the former:

echo "channels:"    > ~/.condarc
echo " - defaults" >> ~/.condarc

echo 'channels:      #!final'   > ${MAMBA_ROOT_PREFIX}/.condarc
echo ' - conda-forge #!top'    >> ${MAMBA_ROOT_PREFIX}/.condarc
echo ' - nodefaults  #!bottom' >> ${MAMBA_ROOT_PREFIX}/.condarc

Now let's try and install some packages - I would expect them to be sourced from conda-forge:

micromamba install -p ${MAMBA_ROOT_PREFIX} python numpy

But no, micromamba proposes to install the packages from main:

Details
warning  libmamba 'repo.anaconda.com', a commercial channel hosted by Anaconda.com, is used.

warning  libmamba Please make sure you understand Anaconda Terms of Services.

warning  libmamba See: https://legal.anaconda.com/policies/en/
warning  libmamba 'repo.anaconda.com', a commercial channel hosted by Anaconda.com, is used.

warning  libmamba Please make sure you understand Anaconda Terms of Services.

warning  libmamba See: https://legal.anaconda.com/policies/en/
warning  libmamba 'repo.anaconda.com', a commercial channel hosted by Anaconda.com, is used.

warning  libmamba Please make sure you understand Anaconda Terms of Services.

warning  libmamba See: https://legal.anaconda.com/policies/en/
warning  libmamba 'repo.anaconda.com', a commercial channel hosted by Anaconda.com, is used.

warning  libmamba Please make sure you understand Anaconda Terms of Services.

warning  libmamba See: https://legal.anaconda.com/policies/en/
pkgs/main/noarch                                   741.7kB @ 668.5kB/s  1.1s
pkgs/r/noarch                                        2.0MB @ 908.4kB/s  2.2s
pkgs/r/linux-64                                      1.6MB @ 664.4kB/s  2.4s
nodefaults/linux-64                                 ??.?MB @  ??.?MB/s  0.8s
nodefaults/noarch                                   ??.?MB @  ??.?MB/s  0.8s
conda-forge/noarch                                  19.2MB @   2.5MB/s  7.6s
pkgs/main/linux-64                                   7.1MB @ 702.0kB/s 10.1s
conda-forge/linux-64                                42.2MB @   2.2MB/s 19.3s


Transaction

  Prefix: /micromamba

  Updating specs:

   - python
   - numpy


  Package                Version  Build               Channel        Size
───────────────────────────────────────────────────────────────────────────
  Install:
───────────────────────────────────────────────────────────────────────────

  + _libgcc_mutex            0.1  main                pkgs/main       3kB
  + _openmp_mutex            5.1  1_gnu               pkgs/main      21kB
  + blas                     1.0  openblas            pkgs/main      47kB
  + bzip2                  1.0.8  h5eee18b_6          pkgs/main     268kB
  + ca-certificates   2024.12.31  h06a4308_0          pkgs/main     131kB
  + expat                  2.6.4  h6a678d5_0          pkgs/main     184kB
  + ld_impl_linux-64        2.40  h12ee557_0          pkgs/main     727kB
  + libffi                 3.4.4  h6a678d5_1          pkgs/main     145kB
  + libgcc-ng             11.2.0  h1234567_1          pkgs/main       6MB
  + libgfortran-ng        11.2.0  h00389a5_1          pkgs/main      20kB
  + libgfortran5          11.2.0  h1234567_1          pkgs/main       2MB
  + libgomp               11.2.0  h1234567_1          pkgs/main     485kB
  + libmpdec               4.0.0  h5eee18b_0          pkgs/main      88kB
  + libopenblas           0.3.21  h043d6bf_0          pkgs/main       6MB
  + libstdcxx-ng          11.2.0  h1234567_1          pkgs/main       5MB
  + libuuid               1.41.5  h5eee18b_0          pkgs/main      28kB
  + ncurses                  6.4  h6a678d5_0          pkgs/main     936kB
  + numpy                  2.2.2  py313h3a69d60_0     pkgs/main      11kB
  + numpy-base             2.2.2  py313habf87d0_0     pkgs/main       9MB
  + openssl               3.0.15  h5eee18b_0          pkgs/main       5MB
  + pip                     25.0  py313h06a4308_0     pkgs/main       3MB
  + python                3.13.2  hf623796_100_cp313  pkgs/main      38MB
  + python_abi              3.13  0_cp313             pkgs/main       6kB
  + readline                 8.2  h5eee18b_0          pkgs/main     365kB
  + setuptools            72.1.0  py313h06a4308_0     pkgs/main       3MB
  + sqlite                3.45.3  h5eee18b_0          pkgs/main       1MB
  + tk                    8.6.14  h39e8969_0          pkgs/main       4MB
  + tzdata                 2025a  h04d1e81_0          pkgs/main     120kB
  + wheel                 0.45.1  py313h06a4308_0     pkgs/main     148kB
  + xz                     5.6.4  h5eee18b_1          pkgs/main     580kB
  + zlib                  1.2.13  h5eee18b_1          pkgs/main     113kB

  Summary:

  Install: 31 packages

  Total download: 85MB

───────────────────────────────────────────────────────────────────────────

Output of micromamba config list:

channels:
  - defaults
  - conda-forge
  - nodefaults

Output of micromamba config sources:

Configuration files (by precedence order):
~/.condarc
/micromamba/.condarc

Output of micromamba info:

Details
       libmamba version : 2.0.5
     micromamba version : 2.0.5
           curl version : libcurl/8.11.1 OpenSSL/3.4.0 zlib/1.3.1 zstd/1.5.6 libssh2/1.11.1 nghttp2/1.64.0
     libarchive version : libarchive 3.7.7 zlib/1.3.1 bz2lib/1.0.8 libzstd/1.5.6
       envs directories : /micromamba/envs
          package cache : /micromamba/pkgs
                          /root/.mamba/pkgs
            environment : base
           env location : /micromamba
      user config files : /root/.mambarc
 populated config files : /root/.condarc
                          /micromamba/.condarc
       virtual packages : __unix=0=0
                          __linux=6.8.0=0
                          __glibc=2.34=0
                          __archspec=1=x86_64_v3
               channels : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://conda.anaconda.org/nodefaults/linux-64
                          https://conda.anaconda.org/nodefaults/noarch
       base environment : /micromamba
               platform : linux-64

I can perform the same experiement with Miniforge instead of micromamba (this is in a new docker container):

dnf update
dnf install --allowerasing -y curl bzip2 tar

curl -OL https://github.com/conda-forge/miniforge/releases/download/25.1.1-0/Miniforge3-25.1.1-0-Linux-x86_64.sh

sh Miniforge3-25.1.1-0-Linux-x86_64.sh -b -p /miniforge3/
echo "channels:"    > ~/.condarc
echo " - defaults" >> ~/.condarc

echo 'channels:      #!final'   > /miniforge3/.condarc
echo ' - conda-forge #!top'    >> /miniforge3/.condarc
echo ' - nodefaults  #!bottom' >> /miniforge3/.condarc

Now attempting to install the packages:

/miniforge3/bin/conda install python numpy

I get the expected behaviour, i.e. the requested packages are sourced from conda-forge:

Details
Channels:
 - conda-forge
 - nodefaults
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /miniforge3

  added / updated specs:
    - numpy
    - python


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    certifi-2025.1.31          |     pyhd8ed1ab_0         159 KB  conda-forge
    conda-25.1.1               |  py312h7900ff3_1         1.1 MB  conda-forge
    libblas-3.9.0              |31_h59b9bed_openblas          16 KB  conda-forge
    libcblas-3.9.0             |31_he106b2a_openblas          16 KB  conda-forge
    libgfortran-14.2.0         |       h69a702a_2          52 KB  conda-forge
    libgfortran5-14.2.0        |       hf1ad2bd_2         1.4 MB  conda-forge
    liblapack-3.9.0            |31_h7ac8fdf_openblas          16 KB  conda-forge
    libopenblas-0.3.29         |pthreads_h94d23a6_0         5.6 MB  conda-forge
    numpy-2.2.3                |  py312h72c5963_0         8.1 MB  conda-forge
    openssl-3.4.1              |       h7b32b05_0         2.8 MB  conda-forge
    python-3.12.9              |h9e4cc4f_0_cpython        30.1 MB  conda-forge
    ------------------------------------------------------------
                                           Total:        49.4 MB

The following NEW packages will be INSTALLED:

  libblas            conda-forge/linux-64::libblas-3.9.0-31_h59b9bed_openblas
  libcblas           conda-forge/linux-64::libcblas-3.9.0-31_he106b2a_openblas
  libgfortran        conda-forge/linux-64::libgfortran-14.2.0-h69a702a_2
  libgfortran5       conda-forge/linux-64::libgfortran5-14.2.0-hf1ad2bd_2
  liblapack          conda-forge/linux-64::liblapack-3.9.0-31_h7ac8fdf_openblas
  libopenblas        conda-forge/linux-64::libopenblas-0.3.29-pthreads_h94d23a6_0
  numpy              conda-forge/linux-64::numpy-2.2.3-py312h72c5963_0

The following packages will be UPDATED:

  certifi                           2024.12.14-pyhd8ed1ab_0 --> 2025.1.31-pyhd8ed1ab_0
  conda                              25.1.1-py312h7900ff3_0 --> 25.1.1-py312h7900ff3_1
  openssl                                  3.4.0-h7b32b05_1 --> 3.4.1-h7b32b05_0
  python                          3.12.8-h9e4cc4f_1_cpython --> 3.12.9-h9e4cc4f_0_cpython

Output of mamba config list and config sources:

[root@237ea3984070 /]# /miniforge3/bin/mamba config list
channels:
  - defaults
  - conda-forge
  - nodefaults
[root@237ea3984070 /]# /miniforge3/bin/mamba config sources
Configuration files (by precedence order):
~/.condarc
/miniforge3/.condarc

Output of mamba info:

Details
[root@237ea3984070 /]# /miniforge3/bin/mamba info

       libmamba version : 2.0.6
          mamba version : 2.0.6
           curl version : libcurl/8.11.1 OpenSSL/3.4.0 zlib/1.3.1 zstd/1.5.6 libssh2/1.11.1 nghttp2/1.64.0
     libarchive version : libarchive 3.7.7 zlib/1.3.1 liblzma/5.6.3 bz2lib/1.0.8 liblz4/1.10.0 libzstd/1.5.6
       envs directories : /miniforge3/envs
          package cache : /miniforge3/pkgs
                          /root/.mamba/pkgs
            environment : base
           env location : /miniforge3
      user config files : /root/.mambarc
 populated config files : /root/.condarc
                          /miniforge3/.condarc
       virtual packages : __unix=0=0
                          __linux=6.8.0=0
                          __glibc=2.34=0
                          __archspec=1=x86_64_v3
               channels : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://conda.anaconda.org/nodefaults/linux-64
                          https://conda.anaconda.org/nodefaults/noarch
       base environment : /miniforge3
               platform : linux-64

For context, we are using micromamba to install our software on end-user systems; in order to make our software installation immune to any settings which may be present in the user's ~/.condarc file, we install a carefully crafted .condarc file into ${MAMBA_ROOT_PREFIX}, which contains our channel list, and includes nodefaults. We have recently switched over from miniforge/miniconda to micromamba, and in general are much happier - we really appreciate the hard work you've been doing on it!

Metadata

Metadata

Assignees

No one assigned

    Labels

    type::bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions