Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

poetry SolverProblemError when trying to lock an environment containing a matplotlib pip dependency #155

Closed
lesteve opened this issue Feb 24, 2022 · 1 comment · Fixed by #157
Labels
bug Something isn't working

Comments

@lesteve
Copy link
Contributor

lesteve commented Feb 24, 2022

# /tmp/environment.yml
channels:
  - conda-forge
dependencies:
  - python=3.9
  - pip
  - pip:
    - matplotlib
conda-lock lock -p linux-64 -f /tmp/environment.yml 

Error:

poetry.puzzle.exceptions.SolverProblemError: Because -dummy-package- depends on matplotlib-base (*) which doesn't match any versions, version solving failed.

Probably there is some conversion logic between conda-forge and pip package names that kicks in although it should not?

Full output:

❯ conda-lock lock -p linux-64 -f /tmp/environment.yml 
Locking dependencies for ['linux-64']...
Traceback (most recent call last):
  File "/home/local/lesteve/miniconda3/envs/conda-lock/lib/python3.10/site-packages/poetry/puzzle/solver.py", line 233, in _solve
    result = resolve_version(
  File "/home/local/lesteve/miniconda3/envs/conda-lock/lib/python3.10/site-packages/poetry/mixology/__init__.py", line 7, in resolve_version
    return solver.solve()
  File "/home/local/lesteve/miniconda3/envs/conda-lock/lib/python3.10/site-packages/poetry/mixology/version_solver.py", line 83, in solve
    self._propagate(next)
  File "/home/local/lesteve/miniconda3/envs/conda-lock/lib/python3.10/site-packages/poetry/mixology/version_solver.py", line 123, in _propagate
    root_cause = self._resolve_conflict(incompatibility)
  File "/home/local/lesteve/miniconda3/envs/conda-lock/lib/python3.10/site-packages/poetry/mixology/version_solver.py", line 321, in _resolve_conflict
    raise SolveFailure(incompatibility)
poetry.mixology.failure.SolveFailure: Because -dummy-package- depends on matplotlib-base (*) which doesn't match any versions, version solving failed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/local/lesteve/miniconda3/envs/conda-lock/bin/conda-lock", line 8, in <module>
    sys.exit(main())
  File "/home/local/lesteve/miniconda3/envs/conda-lock/lib/python3.10/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/local/lesteve/miniconda3/envs/conda-lock/lib/python3.10/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/local/lesteve/miniconda3/envs/conda-lock/lib/python3.10/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/local/lesteve/miniconda3/envs/conda-lock/lib/python3.10/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/local/lesteve/miniconda3/envs/conda-lock/lib/python3.10/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/local/lesteve/miniconda3/envs/conda-lock/lib/python3.10/site-packages/conda_lock/conda_lock.py", line 1086, in lock
    lock_func(
  File "/home/local/lesteve/miniconda3/envs/conda-lock/lib/python3.10/site-packages/conda_lock/conda_lock.py", line 885, in run_lock
    make_lock_files(
  File "/home/local/lesteve/miniconda3/envs/conda-lock/lib/python3.10/site-packages/conda_lock/conda_lock.py", line 323, in make_lock_files
    lock_content = lock_content | create_lockfile_from_spec(
  File "/home/local/lesteve/miniconda3/envs/conda-lock/lib/python3.10/site-packages/conda_lock/conda_lock.py", line 655, in create_lockfile_from_spec
    deps = _solve_for_arch(
  File "/home/local/lesteve/miniconda3/envs/conda-lock/lib/python3.10/site-packages/conda_lock/conda_lock.py", line 621, in _solve_for_arch
    pip_deps = solve_pypi(
  File "/home/local/lesteve/miniconda3/envs/conda-lock/lib/python3.10/site-packages/conda_lock/pypi_solver.py", line 241, in solve_pypi
    result = s.solve(use_latest=to_update)
  File "/home/local/lesteve/miniconda3/envs/conda-lock/lib/python3.10/site-packages/poetry/puzzle/solver.py", line 65, in solve
    packages, depths = self._solve(use_latest=use_latest)
  File "/home/local/lesteve/miniconda3/envs/conda-lock/lib/python3.10/site-packages/poetry/puzzle/solver.py", line 241, in _solve
    raise SolverProblemError(e)
poetry.puzzle.exceptions.SolverProblemError: Because -dummy-package- depends on matplotlib-base (*) which doesn't match any versions, version solving failed.
mariusvniekerk added a commit to mariusvniekerk/conda-lock that referenced this issue Mar 1, 2022
@mariusvniekerk mariusvniekerk added the bug Something isn't working label Mar 2, 2022
mariusvniekerk added a commit to mariusvniekerk/conda-lock that referenced this issue Mar 2, 2022
@lesteve
Copy link
Contributor Author

lesteve commented Mar 7, 2022

Nice, thanks a lot for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants