Open jameslamb opened 1 day ago
Thank you for the report. Looking into it!
This seems to be a bug in libmamba
itself, not our wrapper.
This doesn't work:
>>> LibmambaMatchSpec.parse("python[version='~=3.11.0',build=*_cpython]")
libmambapy.bindings.specs.ParseError: Error parsing MatchSpec "python[version='>=3.11.0',3.11.*": Parentheses mismatch in "python[version='>=3.11.0',3.11.*"."
And this is strange:
>>> spec = LibmambaMatchSpec.parse('python~=3.11.0=*_cpython')
>>> print(spec)
python[version=">=3.11.0",build="*_cpython,3.11.*"]
I'll forward to the mamba folks.
In the meantime, consider using the alternative syntax python>=3.11,<3.12.0a0
.
Reported as https://github.com/mamba-org/mamba/issues/3647.
Checklist
What happened?
In an environment with
libmambapy
v2 andconda
2024.11.0, trying to change thepython
version like this:Results in an error like this:
I strongly suspect that's related to the refactoring in https://github.com/conda/conda-libmamba-solver/pull/457, though don't see the exact root cause yet.
This error does not occur with
libmambapy
1.5.9 andconda
2024.9.0.Included a reproducible example in "Additional Context" below.
Conda Info
Conda Config
Conda list
Additional Context
Running the following:
That works without issue, and finds:
output of 'conda info' (click me)
```text active environment : base active env location : /opt/conda shell level : 1 user config file : /root/.condarc populated config files : /opt/conda/.condarc conda version : 24.9.2 conda-build version : not installed python version : 3.12.7.final.0 solver : libmamba (default) virtual packages : __archspec=1=aarch64 __conda=24.9.2=0 __glibc=2.31=0 __linux=6.5.0=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/24.9.2 requests/2.32.3 CPython/3.12.7 Linux/6.5.0-44-generic ubuntu/20.04.6 glibc/2.31 solver/libmamba conda-libmamba-solver/24.9.0 libmambapy/1.5.9 UID:GID : 0:0 netrc file : None offline mode : False ```output of 'conda env export -n base' (click me)
```text name: base channels: - conda-forge dependencies: - _openmp_mutex=4.5=2_gnu - archspec=0.2.3=pyhd8ed1ab_0 - boltons=24.0.0=pyhd8ed1ab_0 - brotli-python=1.1.0=py312h6f74592_2 - bzip2=1.0.8=h68df207_7 - c-ares=1.32.3=h68df207_0 - ca-certificates=2024.8.30=hcefe29a_0 - certifi=2024.8.30=pyhd8ed1ab_0 - cffi=1.17.1=py312hac81daf_0 - charset-normalizer=3.4.0=pyhd8ed1ab_0 - colorama=0.4.6=pyhd8ed1ab_0 - conda=24.9.2=py312h996f985_0 - conda-libmamba-solver=24.9.0=pyhd8ed1ab_0 - conda-package-handling=2.4.0=pyh7900ff3_0 - conda-package-streaming=0.11.0=pyhd8ed1ab_0 - distro=1.9.0=pyhd8ed1ab_0 - fmt=10.2.1=h2a328a1_0 - frozendict=2.4.6=py312hb2c0f52_0 - h2=4.1.0=pyhd8ed1ab_0 - hpack=4.0.0=pyh9f0ad1d_0 - hyperframe=6.0.1=pyhd8ed1ab_0 - icu=75.1=hf9b3779_0 - idna=3.10=pyhd8ed1ab_0 - jsonpatch=1.33=pyhd8ed1ab_0 - jsonpointer=3.0.0=py312h996f985_1 - keyutils=1.6.1=h4e544f5_0 - krb5=1.21.3=h50a48e9_0 - ld_impl_linux-aarch64=2.43=h80caac9_2 - libarchive=3.7.4=h2c0effa_0 - libcurl=8.10.1=h3ec0cbf_0 - libedit=3.1.20191231=he28a2e2_2 - libev=4.33=h31becfc_2 - libexpat=2.6.4=h5ad3122_0 - libffi=3.4.2=h3557bc0_5 - libgcc=14.2.0=he277a41_1 - libgcc-ng=14.2.0=he9431aa_1 - libgomp=14.2.0=he277a41_1 - libiconv=1.17=h31becfc_2 - libmamba=1.5.9=hee7cc92_0 - libmambapy=1.5.9=py312hc6280c9_0 - libnghttp2=1.64.0=hc8609a4_0 - libnsl=2.0.1=h31becfc_0 - libsolv=0.7.30=h62756fc_0 - libsqlite=3.47.0=hc4a20ef_1 - libssh2=1.11.0=h492db2e_0 - libstdcxx=14.2.0=h3f4de04_1 - libstdcxx-ng=14.2.0=hf1166c9_1 - libuuid=2.38.1=hb4cce97_0 - libxcrypt=4.4.36=h31becfc_1 - libxml2=2.13.4=hf4efe5d_2 - libzlib=1.3.1=h86ecc28_2 - lz4-c=1.9.4=hd600fc2_0 - lzo=2.10=h31becfc_1001 - mamba=1.5.9=py312hd80a4d2_0 - menuinst=2.2.0=py312h996f985_0 - ncurses=6.5=hcccb83c_1 - openssl=3.3.2=h86ecc28_0 - packaging=24.1=pyhd8ed1ab_0 - pip=24.3.1=pyh8b19718_0 - platformdirs=4.3.6=pyhd8ed1ab_0 - pluggy=1.5.0=pyhd8ed1ab_0 - pybind11-abi=4=hd8ed1ab_3 - pycosat=0.6.6=py312hdd3e373_0 - pycparser=2.22=pyhd8ed1ab_0 - pysocks=1.7.1=pyha2e5f31_6 - python=3.12.7=h5d932e8_0_cpython - python_abi=3.12=5_cp312 - readline=8.2=h8fc344f_1 - reproc=14.2.4.post0=h31becfc_1 - reproc-cpp=14.2.4.post0=h2f0025b_1 - requests=2.32.3=pyhd8ed1ab_0 - ruamel.yaml=0.18.6=py312hb2c0f52_1 - ruamel.yaml.clib=0.2.8=py312hb2c0f52_1 - setuptools=75.3.0=pyhd8ed1ab_0 - tk=8.6.13=h194ca79_0 - tqdm=4.67.0=pyhd8ed1ab_0 - truststore=0.10.0=pyhd8ed1ab_0 - tzdata=2024b=hc8b5060_0 - urllib3=2.2.3=pyhd8ed1ab_0 - wheel=0.45.0=pyhd8ed1ab_0 - xz=5.2.6=h9cdd2b7_0 - yaml-cpp=0.8.0=h2f0025b_0 - zstandard=0.23.0=py312hb698573_1 - zstd=1.5.6=h02f22dd_0 prefix: /opt/conda ```However, if I first upgrade to the latest
conda
.output of 'conda info' (click me)
```text active environment : base active env location : /opt/conda shell level : 1 user config file : /root/.condarc populated config files : /opt/conda/.condarc conda version : 24.11.0 conda-build version : not installed python version : 3.12.7.final.0 solver : libmamba (default) virtual packages : __archspec=1=aarch64 __conda=24.11.0=0 __glibc=2.31=0 __linux=6.5.0=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/24.11.0 requests/2.32.3 CPython/3.12.7 Linux/6.5.0-44-generic ubuntu/20.04.6 glibc/2.31 solver/libmamba conda-libmamba-solver/24.11.0 libmambapy/2.0.4 UID:GID : 0:0 netrc file : None offline mode : False ```output of 'conda env export -n base' (click me)
```text name: base channels: - conda-forge dependencies: - _openmp_mutex=4.5=2_gnu - archspec=0.2.3=pyhd8ed1ab_0 - boltons=24.0.0=pyhd8ed1ab_0 - brotli-python=1.1.0=py312h6f74592_2 - bzip2=1.0.8=h68df207_7 - c-ares=1.34.3=h86ecc28_1 - ca-certificates=2024.8.30=hcefe29a_0 - certifi=2024.8.30=pyhd8ed1ab_0 - cffi=1.17.1=py312hac81daf_0 - charset-normalizer=3.4.0=pyhd8ed1ab_0 - colorama=0.4.6=pyhd8ed1ab_0 - conda=24.11.0=py312h996f985_0 - conda-libmamba-solver=24.11.0=pyhd8ed1ab_0 - conda-package-handling=2.4.0=pyh7900ff3_0 - conda-package-streaming=0.11.0=pyhd8ed1ab_0 - cpp-expected=1.1.0=h4c384f3_0 - distro=1.9.0=pyhd8ed1ab_0 - fmt=11.0.2=h70be974_0 - frozendict=2.4.6=py312hb2c0f52_0 - h2=4.1.0=pyhd8ed1ab_0 - hpack=4.0.0=pyh9f0ad1d_0 - hyperframe=6.0.1=pyhd8ed1ab_0 - icu=75.1=hf9b3779_0 - idna=3.10=pyhd8ed1ab_0 - jsonpatch=1.33=pyhd8ed1ab_0 - jsonpointer=3.0.0=py312h996f985_1 - keyutils=1.6.1=h4e544f5_0 - krb5=1.21.3=h50a48e9_0 - ld_impl_linux-aarch64=2.43=h80caac9_2 - libarchive=3.7.7=h2f0f0fe_0 - libcurl=8.10.1=h3ec0cbf_0 - libedit=3.1.20191231=he28a2e2_2 - libev=4.33=h31becfc_2 - libexpat=2.6.4=h5ad3122_0 - libffi=3.4.2=h3557bc0_5 - libgcc=14.2.0=he277a41_1 - libgcc-ng=14.2.0=he9431aa_1 - libgomp=14.2.0=he277a41_1 - libiconv=1.17=h31becfc_2 - libmamba=2.0.4=h489cd8b_0 - libmambapy=2.0.4=py312h33c3f33_0 - libnghttp2=1.64.0=hc8609a4_0 - libnsl=2.0.1=h31becfc_0 - libsolv=0.7.30=h62756fc_0 - libsqlite=3.47.0=hc4a20ef_1 - libssh2=1.11.1=ha41c0db_0 - libstdcxx=14.2.0=h3f4de04_1 - libstdcxx-ng=14.2.0=hf1166c9_1 - libuuid=2.38.1=hb4cce97_0 - libxcrypt=4.4.36=h31becfc_1 - libxml2=2.13.5=hf4efe5d_0 - libzlib=1.3.1=h86ecc28_2 - lz4-c=1.9.4=hd600fc2_0 - lzo=2.10=h31becfc_1001 - mamba=2.0.4=hef03586_0 - menuinst=2.2.0=py312h996f985_0 - ncurses=6.5=hcccb83c_1 - nlohmann_json=3.11.3=h0a1ffab_1 - openssl=3.4.0=h86ecc28_0 - packaging=24.2=pyhff2d567_1 - pip=24.3.1=pyh8b19718_0 - platformdirs=4.3.6=pyhd8ed1ab_0 - pluggy=1.5.0=pyhd8ed1ab_0 - pybind11-abi=4=hd8ed1ab_3 - pycosat=0.6.6=py312hb2c0f52_2 - pycparser=2.22=pyhd8ed1ab_0 - pysocks=1.7.1=pyha2e5f31_6 - python=3.12.7=h5d932e8_0_cpython - python_abi=3.12=5_cp312 - readline=8.2=h8fc344f_1 - reproc=14.2.4.post0=h31becfc_1 - reproc-cpp=14.2.4.post0=h2f0025b_1 - requests=2.32.3=pyhd8ed1ab_0 - ruamel.yaml=0.18.6=py312hb2c0f52_1 - ruamel.yaml.clib=0.2.8=py312hb2c0f52_1 - setuptools=75.6.0=pyhff2d567_1 - simdjson=3.10.1=h17cf362_0 - spdlog=1.14.1=h9d9cc24_1 - tk=8.6.13=h194ca79_0 - tqdm=4.67.1=pyhd8ed1ab_0 - truststore=0.10.0=pyhd8ed1ab_0 - tzdata=2024b=hc8b5060_0 - urllib3=2.2.3=pyhd8ed1ab_0 - wheel=0.45.1=pyhd8ed1ab_1 - xz=5.2.6=h9cdd2b7_0 - yaml-cpp=0.8.0=h2f0025b_0 - zstandard=0.23.0=py312hb698573_1 - zstd=1.5.6=h02f22dd_0 prefix: /opt/conda ```Then try that install again
Results in this error:
full error output (click me)
```text Channels: - conda-forge Platform: linux-aarch64 Collecting package metadata (repodata.json): done Solving environment: failed # >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<< Traceback (most recent call last): File "/opt/conda/lib/python3.12/site-packages/conda/exception_handler.py", line 18, in __call__ return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.12/site-packages/conda/cli/main.py", line 61, in main_subshell exit_code = do_call(args, parser) ^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.12/site-packages/conda/cli/conda_argparse.py", line 205, in do_call result = getattr(module, func_name)(args, parser) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.12/site-packages/conda/notices/core.py", line 132, in wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.12/site-packages/conda/cli/main_install.py", line 152, in execute return install(args, parser, "install") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.12/site-packages/conda/cli/install.py", line 409, in install unlink_link_transaction = solver.solve_for_transaction( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.12/site-packages/conda/core/solve.py", line 153, in solve_for_transaction unlink_precs, link_precs = self.solve_for_diff( ^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.12/site-packages/conda/core/solve.py", line 222, in solve_for_diff final_precs = self.solve_final_state( ^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.12/site-packages/conda_libmamba_solver/solver.py", line 180, in solve_final_state out_state = self._solving_loop(in_state, out_state, index) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.12/site-packages/conda/common/io.py", line 87, in decorated return f(*args, **kwds) ^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.12/site-packages/conda_libmamba_solver/solver.py", line 306, in _solving_loop solved, outcome = self._solve_attempt(in_state, out_state, index, attempt=attempt) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.12/site-packages/conda_libmamba_solver/solver.py", line 355, in _solve_attempt jobs = self._specs_to_request_jobs(in_state, out_state) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.12/site-packages/conda_libmamba_solver/solver.py", line 408, in _specs_to_request_jobs libmamba_spec = self._conda_spec_to_libmamba_spec(conda_spec) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.12/site-packages/conda_libmamba_solver/solver.py", line 888, in _conda_spec_to_libmamba_spec return LibmambaMatchSpec.parse(str(spec)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ libmambapy.bindings.specs.ParseError: Error parsing MatchSpec "python[version='>=3.11.0',3.11.*": Parentheses mismatch in "python[version='>=3.11.0',3.11.*"." `$ /opt/conda/bin/conda install --dry-run -n base python~=3.11.0=*_cpython` environment variables: CIO_TEST=