[X] My problem is not solved in the Troubleshooting docs
Anaconda default channels
[X] I do NOT use the Anaconda default channels (pkgs/* etc.)
How did you install Mamba?
Mambaforge or latest Miniforge
Search tried in issue tracker
Found invalid version predicate in
Latest version of Mamba
[X] My problem is not solved with the latest version
Tried in Conda?
Not applicable
Describe your issue
If a conflict involves a pinned package (e.g. python) and flags.allow_uninstall=False, unsolvable.explain_problems() fails with libmambapy.bindings.specs.ParseError: Found invalid version predicate in "on python".
Reproducer with Python
```python
import libmambapy
db = libmambapy.solver.libsolv.Database(
libmambapy.specs.ChannelResolveParams(
channel_alias=libmambapy.specs.CondaURL.parse("https://conda.anaconda.org")
)
)
print("loading repodata")
repos = [
db.add_repo_from_repodata_json(
path="/opt/conda/pkgs/cache/d9d93fba.json", # taken from the pkgs/cache
url="https://conda.anaconda.org/conda-forge/linux-aarch64",
channel_id="conda-forge",
),
db.add_repo_from_repodata_json(
path="/opt/conda/pkgs/cache/09cdf8bf.json", # taken from the pkgs/cache
url="https://conda.anaconda.org/conda-forge/noarch",
channel_id="conda-forge",
),
]
Request = libmambapy.solver.Request
MatchSpec = libmambapy.specs.MatchSpec
print("crafting request...")
request = Request(
jobs=[
Request.Pin(MatchSpec.parse("python=3.12")),
Request.Install(MatchSpec.parse("numpy=*=*py27*")),
],
flags=Request.Flags(
allow_downgrade=True,
allow_uninstall=False,
force_reinstall=False,
keep_dependencies=True,
keep_user_specs=True,
order_request=False, # we do this ourselves
strict_repo_priority=True,
),
)
print("solving...")
solver = libmambapy.solver.libsolv.Solver()
outcome = solver.solve(db, request)
if isinstance(outcome, libmambapy.solver.libsolv.UnSolvable):
print(outcome.explain_problems(db, libmambapy.Palette.no_color()))
else:
print("OK!")
```
Troubleshooting docs
Anaconda default channels
How did you install Mamba?
Mambaforge or latest Miniforge
Search tried in issue tracker
Found invalid version predicate in
Latest version of Mamba
Tried in Conda?
Not applicable
Describe your issue
If a conflict involves a pinned package (e.g.
python
) andflags.allow_uninstall=False
,unsolvable.explain_problems()
fails withlibmambapy.bindings.specs.ParseError: Found invalid version predicate in "on python"
.Reproducer with Python
```python import libmambapy db = libmambapy.solver.libsolv.Database( libmambapy.specs.ChannelResolveParams( channel_alias=libmambapy.specs.CondaURL.parse("https://conda.anaconda.org") ) ) print("loading repodata") repos = [ db.add_repo_from_repodata_json( path="/opt/conda/pkgs/cache/d9d93fba.json", # taken from the pkgs/cache url="https://conda.anaconda.org/conda-forge/linux-aarch64", channel_id="conda-forge", ), db.add_repo_from_repodata_json( path="/opt/conda/pkgs/cache/09cdf8bf.json", # taken from the pkgs/cache url="https://conda.anaconda.org/conda-forge/noarch", channel_id="conda-forge", ), ] Request = libmambapy.solver.Request MatchSpec = libmambapy.specs.MatchSpec print("crafting request...") request = Request( jobs=[ Request.Pin(MatchSpec.parse("python=3.12")), Request.Install(MatchSpec.parse("numpy=*=*py27*")), ], flags=Request.Flags( allow_downgrade=True, allow_uninstall=False, force_reinstall=False, keep_dependencies=True, keep_user_specs=True, order_request=False, # we do this ourselves strict_repo_priority=True, ), ) print("solving...") solver = libmambapy.solver.libsolv.Solver() outcome = solver.solve(db, request) if isinstance(outcome, libmambapy.solver.libsolv.UnSolvable): print(outcome.explain_problems(db, libmambapy.Palette.no_color())) else: print("OK!") ```mamba info / micromamba info
Logs
No response
environment.yml
No response
~/.condarc
No response