conda / conda-libmamba-solver

The libmamba based solver for conda.
https://conda.github.io/conda-libmamba-solver/
Other
204 stars 24 forks source link

23.9.0 repoquery subcommand breaks mamba command-line on Python 3.11 #303

Closed minrk closed 1 year ago

minrk commented 1 year ago

Checklist

What happened?

Installing up-to-date conda-libmamba-solver (23.9.0), conda (23.7.4), and mamba (1.5.1) results in an entirely non-working mamba command-line:

(base) root@12b182bcc8f6:/# mamba list
argument COMMAND: conflicting subparser: repoquery

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.11/site-packages/conda/exception_handler.py", line 17, in __call__
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/opt/conda/lib/python3.11/site-packages/mamba/mamba.py", line 945, in exception_converter
        raise e
      File "/opt/conda/lib/python3.11/site-packages/mamba/mamba.py", line 938, in exception_converter
        exit_code = _wrapped_main(*args, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/conda/lib/python3.11/site-packages/mamba/mamba.py", line 877, in _wrapped_main
        configure_parser_repoquery(p._subparsers._group_actions[0])
      File "/opt/conda/lib/python3.11/site-packages/mamba/mamba.py", line 805, in configure_parser_repoquery
        p = sub_parsers.add_parser(
            ^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/conda/lib/python3.11/argparse.py", line 1192, in add_parser
        raise ArgumentError(self, _('conflicting subparser: %s') % name)
    argparse.ArgumentError: argument COMMAND: conflicting subparser: repoquery

This appears to be specific to Python 3.11, and may relate to mamba's use of private argparser APIs. 23.7.0 does not have this issue. I don't actually know if this is bug in this package or mamba's own CLI.

Conda Info

active environment : None
       user config file : /root/.condarc
 populated config files : /opt/conda/.condarc
          conda version : 23.7.4
    conda-build version : not installed
         python version : 3.11.5.final.0
       virtual packages : __archspec=1=aarch64
                          __glibc=2.31=0
                          __linux=5.15.49=0
                          __unix=0=0
       base environment : /opt/conda  (writable)
      conda av data dir : /opt/conda/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-aarch64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /opt/conda/pkgs
                          /root/.conda/pkgs
       envs directories : /opt/conda/envs
                          /root/.conda/envs
               platform : linux-aarch64
             user-agent : conda/23.7.4 requests/2.31.0 CPython/3.11.5 Linux/5.15.49-linuxkit-pr ubuntu/20.04.6 glibc/2.31
                UID:GID : 0:0
             netrc file : None
           offline mode : False

Conda Config

==> /opt/conda/.condarc <==
channels:
  - conda-forge

==> cmd_line <==
debug: False
json: False

Conda list

# packages in environment at /opt/conda:
#
# Name                    Version                   Build  Channel
_openmp_mutex             4.5                       2_gnu    conda-forge
boltons                   23.0.0             pyhd8ed1ab_0    conda-forge
brotli-python             1.1.0           py311h8715677_0    conda-forge
bzip2                     1.0.8                hf897c2e_4    conda-forge
c-ares                    1.19.1               h31becfc_0    conda-forge
ca-certificates           2023.7.22            hcefe29a_0    conda-forge
certifi                   2023.7.22          pyhd8ed1ab_0    conda-forge
cffi                      1.15.1          py311h7963103_5    conda-forge
charset-normalizer        3.2.0              pyhd8ed1ab_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
conda                     23.7.4          py311hec3470c_0    conda-forge
conda-libmamba-solver     23.9.0             pyhd8ed1ab_0    conda-forge
conda-package-handling    2.2.0              pyh38be061_0    conda-forge
conda-package-streaming   0.9.0              pyhd8ed1ab_0    conda-forge
cryptography              41.0.4          py311hd42d77a_0    conda-forge
fmt                       10.1.1               h2a328a1_0    conda-forge
icu                       73.2                 h787c7f5_0    conda-forge
idna                      3.4                pyhd8ed1ab_0    conda-forge
jsonpatch                 1.33               pyhd8ed1ab_0    conda-forge
jsonpointer               2.4             py311hec3470c_3    conda-forge
keyutils                  1.6.1                h4e544f5_0    conda-forge
krb5                      1.21.2               hc419048_0    conda-forge
ld_impl_linux-aarch64     2.40                 h2d8c526_0    conda-forge
libarchive                3.6.2                h566b526_1    conda-forge
libcurl                   8.3.0                h4e8248e_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libexpat                  2.5.0                hd600fc2_1    conda-forge
libffi                    3.4.2                h3557bc0_5    conda-forge
libgcc-ng                 13.2.0               hf8544c7_2    conda-forge
libgomp                   13.2.0               hf8544c7_2    conda-forge
libiconv                  1.17                 h9cdd2b7_0    conda-forge
libmamba                  1.5.1                h604a1c0_0    conda-forge
libmambapy                1.5.1           py311h765b69a_0    conda-forge
libnghttp2                1.52.0               h250e5c5_0    conda-forge
libnsl                    2.0.0                h31becfc_1    conda-forge
libsolv                   0.7.24               hd84c7bf_4    conda-forge
libsqlite                 3.43.0               h194ca79_0    conda-forge
libssh2                   1.11.0               h492db2e_0    conda-forge
libstdcxx-ng              13.2.0               h9a76618_2    conda-forge
libuuid                   2.38.1               hb4cce97_0    conda-forge
libxml2                   2.11.5               h3091e33_1    conda-forge
libzlib                   1.2.13               h31becfc_5    conda-forge
lz4-c                     1.9.4                hd600fc2_0    conda-forge
lzo                       2.10              h516909a_1000    conda-forge
mamba                     1.5.1           py311hb6c5aa6_0    conda-forge
ncurses                   6.4                  h2e1726e_0    conda-forge
openssl                   3.1.3                h31becfc_0    conda-forge
packaging                 23.1               pyhd8ed1ab_0    conda-forge
pip                       23.2.1             pyhd8ed1ab_0    conda-forge
pluggy                    1.3.0              pyhd8ed1ab_0    conda-forge
pybind11-abi              4                    hd8ed1ab_3    conda-forge
pycosat                   0.6.4           py311hcd402e7_2    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pyopenssl                 23.2.0             pyhd8ed1ab_1    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
python                    3.11.5          h43d1f9e_0_cpython    conda-forge
python_abi                3.11                    4_cp311    conda-forge
readline                  8.2                  h8fc344f_1    conda-forge
reproc                    14.2.4               hb4cce97_0    conda-forge
reproc-cpp                14.2.4               hd600fc2_0    conda-forge
requests                  2.31.0             pyhd8ed1ab_0    conda-forge
ruamel.yaml               0.17.32         py311hcd402e7_0    conda-forge
ruamel.yaml.clib          0.2.7           py311h1d6c08a_1    conda-forge
setuptools                68.2.2             pyhd8ed1ab_0    conda-forge
tk                        8.6.13               h194ca79_0    conda-forge
toolz                     0.12.0             pyhd8ed1ab_0    conda-forge
tqdm                      4.66.1             pyhd8ed1ab_0    conda-forge
tzdata                    2023c                h71feb2d_0    conda-forge
urllib3                   2.0.5              pyhd8ed1ab_0    conda-forge
wheel                     0.41.2             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h9cdd2b7_0    conda-forge
yaml-cpp                  0.7.0                h2f0025b_3    conda-forge
zstandard                 0.21.0          py311hb827a26_1    conda-forge
zstd                      1.5.5                h4c53e97_0    conda-forge

Additional Context

To reproduce the env:

docker run --rm -it condaforge/miniforge3:23.3.1-1

and in the container:

mamba install mamba==1.5.1 conda=23.7.4 conda-libmamba-solver=23.9.0 python=3.11
mamba list # fails

To fix the error, revert conda-libmamba-solver to last release:

conda install conda-libmamba-solver=23.7.0
jaimergp commented 1 year ago

Thanks for the report. I'll take a look and see if there's anything we can do from our side.

FWIW conda 23.9.0, which is being released this week, will have incompatibilities with mamba too, so we'll need fixes over there anyway, so I might just combine the changes in a single PR on mamba-org/mamba.

jaimergp commented 1 year ago

Added in https://github.com/mamba-org/mamba/pull/2878

jaimergp commented 1 year ago

mamba 1.5.2 is out. Can you check whether the fix included there is working, @minrk? Thanks!

minrk commented 1 year ago

@jaimergp seems fine with conda 23.9.0, conda-libmamba-solver 23.9.2, mamba 1.5.2. Thanks!