Skip to content

SolverProblemError with multiple constraints and path dependencies #3639

@marecabo

Description

@marecabo
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: Windows 10 1909 x64
  • Poetry version: 1.1.4
  • Python version: 3.8.7 amd64
  • Link of a Gist with the contents of your pyproject.toml file: (please see below)

Issue

First, thank you for your work on poetry!

When executing poetry install and having specified multiple constraints dependencies with path dependencies, the solver tries to install both versions despite mutually excluding python restrictions. The wheels mentioned in the pyproject.toml are from here.

pyproject.toml
[tool.poetry]
name = "fokr"
version = "0.1.0"
description = ""
authors = ["Your Name <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.8"
pyproj = [
    {path = ".python/pyproj-2.6.0-cp38-cp38-win_amd64.whl", python = "~3.8", markers = "sys_platform == 'win32'"},
    {path = ".python/pyproj-3.0.0.post1-cp39-cp39-win_amd64.whl", python = "~3.9", markers = "sys_platform == 'win32'"},
]

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
Console Output
Using virtualenv: D:\***\.venv
Updating dependencies
Resolving dependencies...
   1: fact: fokr is 0.1.0
   1: derived: fokr
   0: Duplicate dependencies for pyproj
   1: fact: fokr depends on pyproj (2.6.0 .python\pyproj-2.6.0-cp38-cp38-win_amd64.whl)
   1: fact: fokr depends on pyproj (3.0.0.post1 .python\pyproj-3.0.0.post1-cp39-cp39-win_amd64.whl)
   1: selecting fokr (0.1.0)
   1: derived: pyproj (3.0.0.post1 .python\pyproj-3.0.0.post1-cp39-cp39-win_amd64.whl)
   1: conflict: fokr depends on pyproj (2.6.0 .python\pyproj-2.6.0-cp38-cp38-win_amd64.whl)
   1: ! not pyproj (2.6.0 .python\pyproj-2.6.0-cp38-cp38-win_amd64.whl) is satisfied by pyproj (3.0.0.post1 .python\pyproj-3.0.0.post1-cp39-cp39-win_amd64.whl)
   1: ! which is caused by "fokr depends on pyproj (3.0.0.post1 .python\pyproj-3.0.0.post1-cp39-cp39-win_amd64.whl)"
   1: ! thus: version solving failed
   1: Version solving took 0.217 seconds.
   1: Tried 1 solutions.

  Stack trace:

  8  d:\***\.python\python\lib\site-packages\clikit\console_application.py:131 in run
      129parsed_args = resolved_command.args
      130│
    → 131status_code = command.handle(parsed_args, io)
      132except KeyboardInterrupt:
      133status_code = 1

  7  d:\***\.python\python\lib\site-packages\clikit\api\command\command.py:120 in handle
      118def handle(self, args, io):  # type: (Args, IO) -> int
      119try:
    → 120status_code = self._do_handle(args, io)
      121except KeyboardInterrupt:
      122if io.is_debug():

  6  d:\***\.python\python\lib\site-packages\clikit\api\command\command.py:171 in _do_handle
      169handler_method = self._config.handler_method
      170│
    → 171return getattr(handler, handler_method)(args, io, self)
      172173def __repr__(self):  # type: () -> str

  5  d:\***\.python\python\lib\site-packages\cleo\commands\command.py:92 in wrap_handle
       90self._command = command
       91│
    →  92return self.handle()
       9394def handle(self):  # type: () -> Optional[int]

  4  d:\***\.python\python\lib\site-packages\poetry\console\commands\install.py:71 in handle
       69self._installer.verbose(self._io.is_verbose())
       70│
    →  71return_code = self._installer.run()
       7273if return_code != 0:

  3  d:\***\.python\python\lib\site-packages\poetry\installation\installer.py:103 in run
      101local_repo = Repository()
      102│
    → 103return self._do_install(local_repo)
      104105def dry_run(self, dry_run=True):  # type: (bool) -> Installer

  2  d:\***\.python\python\lib\site-packages\poetry\installation\installer.py:235 in _do_install
      233│             )
      234│ 
    → 235ops = solver.solve(use_latest=self._whitelist)
      236else:
      237self._io.write_line("Installing dependencies from lock file")

  1  d:\***\.python\python\lib\site-packages\poetry\puzzle\solver.py:65 in solve
       63with self._provider.progress():
       64start = time.time()
    →  65packages, depths = self._solve(use_latest=use_latest)
       66end = time.time()
       67SolverProblemError

  Because fokr depends on both pyproj (2.6.0 .python\pyproj-2.6.0-cp38-cp38-win_amd64.whl) and pyproj (3.0.0.post1 .python\pyproj-3.0.0.post1-cp39-cp39-win_amd64.whl), version solving failed.

  at d:\***\.python\python\lib\site-packages\poetry\puzzle\solver.py:241 in _solve
      237packages = result.packages
      238except OverrideNeeded as e:
      239return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
      240except SolveFailure as e:
    → 241raise SolverProblemError(e)
      242243results = dict(
      244depth_first_search(
      245PackageNode(self._package, packages), aggregate_package_nodes

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions