Skip to content

SolverProblemError with multiple constraints  #5716

@Elendiar

Description

@Elendiar
  • 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).

Issue

Removing {markers = "sys_platform == 'win32'", path = "./wheels/python_ldap-3.4.0-cp310-cp310-win_amd64.whl"} fix error.
Why file not python-ldap (>=3.1) is satisfied by python-ldap (3.4.0 wheels/python_ldap-3.4.0-cp310-cp310-win_amd64.whl) on linux cause exception? But before everything worked, why this error began to occur now I don’t know, I didn’t change anything regarding this.

#0 273.4    1: derived: Django (>=2.2,<4.1)
#0 273.4    1: derived: python-crontab (>=2.3.4)
#0 273.4    1: fact: django-auth-ldap (4.1.0) depends on Django (>=2.2)
#0 273.4    1: fact: django-auth-ldap (4.1.0) depends on python-ldap (>=3.1)
#0 273.4    1: derived: not django-auth-ldap (==4.1.0)
#0 273.4    1: fact: no versions of django-auth-ldap match >4.1.0,<5.0.0
#0 273.4    1: conflict: no versions of django-auth-ldap match >4.1.0,<5.0.0
#0 273.4    1: derived: not django-auth-ldap (>4.1.0,<5.0.0)
#0 273.4    1: conflict: django-auth-ldap (4.1.0) depends on python-ldap (>=3.1)
#0 273.4    1: ! django-auth-ldap (==4.1.0) is partially satisfied by not django-auth-ldap (>4.1.0,<5.0.0)
#0 273.4    1: ! which is caused by "no versions of django-auth-ldap match >4.1.0,<5.0.0"
#0 273.4    1: ! thus: django-auth-ldap (>=4.1.0,<5.0.0) requires python-ldap (>=3.1)
#0 273.4    1: ! not python-ldap (>=3.1) is satisfied by python-ldap (3.4.0 wheels/python_ldap-3.4.0-cp310-cp310-win_amd64.whl)
#0 273.4    1: ! which is caused by "backend depends on python-ldap (3.4.0)"
#0 273.4    1: ! thus: django-auth-ldap is forbidden
#0 273.4    1: ! django-auth-ldap (>=4.1.0,<5.0.0) is satisfied by django-auth-ldap (>=4.1.0,<5.0.0)
#0 273.4    1: ! which is caused by "backend depends on django-auth-ldap (^4.1.0)"
#0 273.4    1: ! thus: version solving failed
#0 273.4    1: Version solving took 17.062 seconds.
#0 273.4    1: Tried 1 solutions.
#0 273.5
#0 273.5   Stack trace:
#0 273.5
#0 273.5   4  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/puzzle/solver.py:133 in _solve
#0 273.5       131│
#0 273.5       132│         try:
#0 273.5     → 133│             result = resolve_version(
#0 273.5       134│                 self._package, self._provider, locked=locked, use_latest=use_latest
#0 273.5       135│             )
#0 273.5
#0 273.5   3  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/mixology/__init__.py:24 in resolve_version
#0 273.6        22│     solver = VersionSolver(root, provider, locked=locked, use_latest=use_latest)
#0 273.6        23│
#0 273.6     →  24│     return solver.solve()
#0 273.6        25│
#0 273.6
#0 273.6   2  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/mixology/version_solver.py:81 in solve
#0 273.6        79│             while next is not None:
#0 273.6        80│                 self._propagate(next)
#0 273.6     →  81│                 next = self._choose_package_version()
#0 273.6        82│
#0 273.6        83│             return self._result()
#0 273.6
#0 273.6   1  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/mixology/version_solver.py:394 in _choose_package_version
#0 273.6       392│             package = locked
#0 273.6       393│
#0 273.6     → 394│         package = self._provider.complete_package(package)
#0 273.6       395│
#0 273.6       396│         conflict = False
#0 273.6
#0 273.6   OverrideNeeded
#0 273.6
#0 273.6   ({Package('backend', '0.1.1'): {'python-ldap': <Dependency python-ldap (>=3.4.0,<4.0.0)>}}, {Package('backend', '0.1.1'): {'python-ldap': <FileDependency python-ldap (3.4.0 wheels/python_ldap-3.4.0-cp310-cp310-win_amd64.whl)>}})
#0 273.6
#0 273.6   at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/puzzle/provider.py:687 in complete_package
#0 273.7       683│                 package_overrides.update({_dep.name: _dep})
#0 273.7       684│                 current_overrides.update({package: package_overrides})
#0 273.7       685│                 overrides.append(current_overrides)
#0 273.7       686│
#0 273.7     → 687│             raise OverrideNeeded(*overrides)
#0 273.7       688│
#0 273.7       689│         # Modifying dependencies as needed
#0 273.7       690│         clean_dependencies = []
#0 273.7       691│         for dep in dependencies:
#0 273.7
#0 273.7 The following error occurred when trying to handle this error:
#0 273.7
#0 273.7
#0 273.7   Stack trace:
#0 273.7
#0 273.7   4  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/puzzle/solver.py:133 in _solve
#0 273.7       131│
#0 273.7       132│         try:
#0 273.7     → 133│             result = resolve_version(
#0 273.7       134│                 self._package, self._provider, locked=locked, use_latest=use_latest
#0 273.7       135│             )
#0 273.7
#0 273.7   3  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/mixology/__init__.py:24 in resolve_version
#0 273.7        22│     solver = VersionSolver(root, provider, locked=locked, use_latest=use_latest)
#0 273.7        23│
#0 273.7     →  24│     return solver.solve()
#0 273.7        25│
#0 273.7
#0 273.7   2  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/mixology/version_solver.py:80 in solve
#0 273.7        78│             next = self._root.name
#0 273.7        79│             while next is not None:
#0 273.7     →  80│                 self._propagate(next)
#0 273.7        81│                 next = self._choose_package_version()
#0 273.7        82│
#0 273.7
#0 273.7   1  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/mixology/version_solver.py:116 in _propagate
#0 273.7       114│                     # where that incompatibility will allow us to derive new assignments
#0 273.7       115│                     # that avoid the conflict.
#0 273.7     → 116│                     root_cause = self._resolve_conflict(incompatibility)
#0 273.7       117│
#0 273.7       118│                     # Back jumping erases all the assignments we did at the previous
#0 273.7
#0 273.7   SolveFailure
#0 273.7
#0 273.7   Because django-auth-ldap (4.1.0) depends on python-ldap (>=3.1)
#0 273.7    and no versions of django-auth-ldap match >4.1.0,<5.0.0, django-auth-ldap (>=4.1.0,<5.0.0) requires python-ldap (>=3.1).
#0 273.7   So, because backend depends on both python-ldap (3.4.0) and django-auth-ldap (^4.1.0), version solving failed.
#0 273.7
#0 273.7   at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/mixology/version_solver.py:306 in _resolve_conflict
#0 273.7       302│             )
#0 273.7       303│             self._log(f'! which is caused by "{most_recent_satisfier.cause}"')
#0 273.7       304│             self._log(f"! thus: {incompatibility}")
#0 273.7       305│
#0 273.7     → 306│         raise SolveFailure(incompatibility)
#0 273.7       307│
#0 273.7       308│     def _choose_package_version(self) -> str | None:
#0 273.7       309│         """
#0 273.7       310│         Tries to select a version of a required package.
#0 273.7
#0 273.7 The following error occurred when trying to handle this error:
#0 273.7
#0 273.7
#0 273.7   Stack trace:
#0 273.7
#0 273.7   13  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/cleo/application.py:330 in run
#0 273.8        328│
#0 273.8        329│             try:
#0 273.8      → 330│                 exit_code = self._run(io)
#0 273.8        331│             except Exception as e:
#0 273.8        332│                 if not self._catch_exceptions:
#0 273.8
#0 273.8   12  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/console/application.py:174 in _run
#0 273.8        172│         self._load_plugins(io)
#0 273.8        173│
#0 273.8      → 174│         return super()._run(io)
#0 273.8        175│
#0 273.8        176│     def _configure_io(self, io: IO) -> None:
#0 273.8
#0 273.8   11  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/cleo/application.py:425 in _run
#0 273.8        423│                 io.set_input(ArgvInput(argv))
#0 273.8        424│
#0 273.8      → 425│         exit_code = self._run_command(command, io)
#0 273.8        426│         self._running_command = None
#0 273.8        427│
#0 273.8
#0 273.8   10  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/cleo/application.py:467 in _run_command
#0 273.9        465│
#0 273.9        466│         if error is not None:
#0 273.9      → 467│             raise error
#0 273.9        468│
#0 273.9        469│         return event.exit_code
#0 273.9
#0 273.9    9  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/cleo/application.py:451 in _run_command
#0 273.9        449│
#0 273.9        450│             if event.command_should_run():
#0 273.9      → 451│                 exit_code = command.run(io)
#0 273.9        452│             else:
#0 273.9        453│                 exit_code = ConsoleCommandEvent.RETURN_CODE_DISABLED
#0 273.9
#0 273.9    8  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/cleo/commands/base_command.py:118 in run
#0 273.9        116│         io.input.validate()
#0 273.9        117│
#0 273.9      → 118│         status_code = self.execute(io)
#0 273.9        119│
#0 273.9        120│         if status_code is None:
#0 273.9
#0 273.9    7  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/cleo/commands/command.py:85 in execute
#0 274.0         83│
#0 274.0         84│         try:
#0 274.0      →  85│             return self.handle()
#0 274.0         86│         except KeyboardInterrupt:
#0 274.0         87│             return 1
#0 274.0
#0 274.0    6  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/console/commands/install.py:171 in handle
#0 274.0        169│         self._installer.verbose(self._io.is_verbose())
#0 274.0        170│
#0 274.0      → 171│         return_code = self._installer.run()
#0 274.0        172│
#0 274.0        173│         if return_code != 0:
#0 274.0
#0 274.0    5  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/installer.py:114 in run
#0 274.0        112│         local_repo = Repository()
#0 274.0        113│
#0 274.0      → 114│         return self._do_install(local_repo)
#0 274.0        115│
#0 274.0        116│     def dry_run(self, dry_run: bool = True) -> Installer:
#0 274.0
#0 274.0    4  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/installer.py:251 in _do_install
#0 274.0        249│             )
#0 274.0        250│
#0 274.0      → 251│             ops = solver.solve(use_latest=self._whitelist).calculate_operations()
#0 274.0        252│         else:
#0 274.0        253│             self._io.write_line("Installing dependencies from lock file")
#0 274.0
#0 274.0    3  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/puzzle/solver.py:74 in solve
#0 274.1         72│         with self._provider.progress():
#0 274.1         73│             start = time.time()
#0 274.1      →  74│             packages, depths = self._solve(use_latest=use_latest)
#0 274.1         75│             end = time.time()
#0 274.1         76│
#0 274.1
#0 274.1    2  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/puzzle/solver.py:139 in _solve
#0 274.1        137│             packages = result.packages
#0 274.1        138│         except OverrideNeeded as e:
#0 274.1      → 139│             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
#0 274.1        140│         except SolveFailure as e:
#0 274.1        141│             raise SolverProblemError(e)
#0 274.1
#0 274.1    1  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/puzzle/solver.py:106 in solve_in_compatibility_mode
#0 274.1        104│             )
#0 274.1        105│             self._provider.set_overrides(override)
#0 274.1      → 106│             _packages, _depths = self._solve(use_latest=use_latest)
#0 274.1        107│             for index, package in enumerate(_packages):
#0 274.1        108│                 if package not in packages:
#0 274.1
#0 274.1   SolverProblemError
#0 274.1
#0 274.1   Because django-auth-ldap (4.1.0) depends on python-ldap (>=3.1)
#0 274.1    and no versions of django-auth-ldap match >4.1.0,<5.0.0, django-auth-ldap (>=4.1.0,<5.0.0) requires python-ldap (>=3.1).
#0 274.1   So, because backend depends on both python-ldap (3.4.0) and django-auth-ldap (^4.1.0), version solving failed.
#0 274.1
#0 274.1   at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/puzzle/solver.py:141 in _solve
#0 274.2       137│             packages = result.packages
#0 274.2       138│         except OverrideNeeded as e:
#0 274.2       139│             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
#0 274.2       140│         except SolveFailure as e:
#0 274.2     → 141│             raise SolverProblemError(e)
#0 274.2       142│
#0 274.2       143│         # NOTE passing explicit empty array for seen to reset between invocations during
#0 274.2       144│         # update + install cycle
#0 274.2       145│         results = dict(
------
failed to solve: executor failed running [/bin/sh -c $HOME/.local/bin/poetry install -vvv --no-ansi --extras "mod_wsgi"]: exit code: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expectedstatus/needs-reproductionIssue needs a minimal reproduction to be confirmed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions