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 fails to resolve dependencies for multiple Python versions #4870

Closed
Darel13712 opened this issue Dec 8, 2021 · 2 comments · Fixed by #4695
Closed

Poetry fails to resolve dependencies for multiple Python versions #4870

Darel13712 opened this issue Dec 8, 2021 · 2 comments · Fixed by #4695
Labels
area/solver Related to the dependency resolver kind/bug Something isn't working as expected

Comments

@Darel13712
Copy link

  • OS version and name: MacOS 10.15.7
  • Poetry version: 1.1.12
  • pyproject.toml: Gist
  • Python: 3.9.7

Issue

My project has a dependency on numpy and lightautoml
Lightautoml's pyproject has dependencies for numpy, and I am able to resolve their dependencies:

python = ">=3.6.1, <3.10"
numpy = [
  {version = ">=1.20.0", python = ">=3.7"},
  {version = "*", python = "<3.7"}
]

However, if I create my own pyproject, that depends both on numpy and lightautoml, dependencies cannot be resolved:

[tool.poetry.dependencies]
python = ">=3.6.2, <3.10"
lightautoml = "==0.3.2"
numpy = [
  {version = ">=1.20.0", python = ">=3.7"},
  {version = "*", python = "<3.7"}
]

It seems that I do not add any new requirements in my pyproject, but if i try to run poetry lock, I get

The current project's Python requirement (>=3.6.2,<3.10) is not compatible with some of the required packages Python requirement:
    - numpy requires Python >=3.7,<3.11, so it will not be satisfied for Python >=3.6.2,<3.7
    - numpy requires Python >=3.7, so it will not be satisfied for Python >=3.6.2,<3.7
    - numpy requires Python >=3.7, so it will not be satisfied for Python >=3.6.2,<3.7
    - numpy requires Python >=3.7, so it will not be satisfied for Python >=3.6.2,<3.7
    - numpy requires Python >=3.7, so it will not be satisfied for Python >=3.6.2,<3.7
    - numpy requires Python >=3.7, so it will not be satisfied for Python >=3.6.2,<3.7
    - numpy requires Python >=3.7, so it will not be satisfied for Python >=3.6.2,<3.7
    - numpy requires Python >=3.7,<3.11, so it will not be satisfied for Python >=3.6.2,<3.7
    - numpy requires Python >=3.7,<3.11, so it will not be satisfied for Python >=3.6.2,<3.7
  
  Because no versions of numpy match >1.20.0,<1.20.1 || >1.20.1,<1.20.2 || >1.20.2,<1.20.3 || >1.20.3,<1.21.0 || >1.21.0,<1.21.1 || >1.21.1,<1.21.2 || >1.21.2,<1.21.3 || >1.21.3,<1.21.4 || >1.21.4
   and numpy (1.20.0) requires Python >=3.7, numpy is forbidden.
  And because numpy (1.20.1) requires Python >=3.7
   and numpy (1.20.2) requires Python >=3.7, numpy is forbidden.
  And because numpy (1.20.3) requires Python >=3.7
   and numpy (1.21.0) requires Python >=3.7, numpy is forbidden.
  And because numpy (1.21.1) requires Python >=3.7
   and numpy (1.21.2) requires Python >=3.7,<3.11, numpy is forbidden.
  And because numpy (1.21.3) requires Python >=3.7,<3.11
   and numpy (1.21.4) requires Python >=3.7,<3.11, numpy is forbidden.
  So, because replay-rec depends on lightautoml (==0.3.2) which depends on numpy (>=1.20.0), version solving failed.

It seems that poetry tries to find a version of numpy that could satisfy all the pythons simultaneously?

Here is the complete log

@Darel13712 Darel13712 added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Dec 8, 2021
@radoering
Copy link
Member

Similar to #3367 but not exactly the same. I improved #4695 so that I was able to lock the sample pyproject.toml.

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
area/solver Related to the dependency resolver kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants