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

SolverProblemError with multiple constraints and path dependencies #3639

Closed
3 tasks done
marecabo opened this issue Feb 3, 2021 · 3 comments · Fixed by python-poetry/poetry-core#324
Closed
3 tasks done
Labels
kind/bug Something isn't working as expected

Comments

@marecabo
Copy link

marecabo commented Feb 3, 2021

  • 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 <you@example.com>"]

[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
@marecabo marecabo added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Feb 3, 2021
@kerryz
Copy link

kerryz commented Mar 2, 2021

Getting the same problem with

[tool.poetry.dependencies]
torch = [
	{version = "1.7.1", markers = "sys_platform == 'darwin'"},
	{version = "1.7.1+cu110", markers = "sys_platform == 'linux' or sys_platform == 'win32'"}
]
torchvision = [
	{version = "0.8.2", markers = "sys_platform == 'darwin'"},
	{version = "0.8.2+cu110", markers = "sys_platform == 'linux' or sys_platform == 'win32'"}
]

[[tool.poetry.source]]
name = "pytorch"
url = "https://eternalphane.github.io/pytorch-pypi/"
secondary = true

CUDA isn't support for macOS, which is why I need to version like this.

@radoering
Copy link
Member

The original issue seems to be a duplicate of #3444. The reason is explained in #4965.

@kerryz The torch/torchvision issue is different. It may be related to local version identifiers (see #2543 and #4231). It may be resolved in 1.2.0b1.

Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
4 participants