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

The current project's Python requirement (>=3.11,<4.0) is not compatible with numpy requires Python <3.13,>=3.9 #8616

Closed
4 tasks done
azataiot opened this issue Nov 3, 2023 · 6 comments
Labels
kind/bug Something isn't working as expected

Comments

@azataiot
Copy link

azataiot commented Nov 3, 2023

  • Poetry version:
  • Python version:
  • OS version and name:
  • pyproject.toml:
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

@azataiot azataiot added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Nov 3, 2023
@azataiot azataiot closed this as completed Nov 3, 2023
@azataiot azataiot reopened this Nov 3, 2023
@azataiot
Copy link
Author

azataiot commented Nov 3, 2023

This is a brand new project:

❯ poetry add numpy
Using version ^1.26.1 for numpy

Updating dependencies
Resolving dependencies... (0.0s)

The current project's Python requirement (>=3.11,<4.0) is not compatible with some of the required packages Python requirement:
  - numpy requires Python <3.13,>=3.9, so it will not be satisfied for Python >=3.13,<4.0

Because no versions of numpy match >1.26.1,<2.0.0
 and numpy (1.26.1) requires Python <3.13,>=3.9, numpy is forbidden.
So, because pycharm depends on numpy (^1.26.1), version solving failed.

  • Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties
    
    For numpy, a possible solution would be to set the `python` property to ">=3.11,<3.13"

contents of the pyproject.toml:

[tool.poetry]
name = "pycharm"
version = "0.1.0"
description = ""
authors = ["Azat <8280770+azataiot@users.noreply.github.com>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.11"
matplotlib = "^3.8.1"
backtrader = "^1.9.78.123"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

@azataiot
Copy link
Author

azataiot commented Nov 3, 2023

current python version is 3.11 which is actually meets the NumPy requirement of <3.13 >=3.9.

@Secrus
Copy link
Member

Secrus commented Nov 3, 2023

Poetry resolves your dependencies for the whole range of Python versions specified in the pyproject.toml file. Your python requirement (^3.11) sets python support on >=3.11, <4, while numpy only supports up to 3.13. That leaves >3.13, <4 range without coverage, hence the failure. Not a bug. Read the error message carefully next time.

@Secrus Secrus closed this as not planned Won't fix, can't repro, duplicate, stale Nov 3, 2023
@renaudjester
Copy link

renaudjester commented Nov 8, 2023

@Secrus It might not be a bug but it seems to be a real pain especially UX wise.

It means that out of the box, if I do poetry init and then poetry add numpy it doesn't work.

And even if for you the error message is crystal clear, it is not that easy to understand what the problem is. Especially that the solution is to restrict the app python dependency in case you start using python 3.14

So I would agree with @azataiot that it is an issue

@azataiot
Copy link
Author

azataiot commented Nov 8, 2023

@Secrus It might not be a bug but it seems to be a real pain especially UX wise.

It means that out of the box, if I do poetry init and then poetry add numpy it doesn't work.

And even if for you the error message is crystal clear, it is not that easy to understand what the problem is. Especially that the solution is to restrict the app python dependency in case you start using python 3.14

So I would agree with @azataiot that it is an issue

Yes, Totally agree.

That python version for the project is generated by poetry, not by hand by me. and Yet it sees the conflict with Numpy's version.

So by default, Poetry includes this "feature" that fails when installing packages. It should generate some 'minimum' working versions instead of that whole range of python versions.

Why NumPy is choosing 3.13 ? I guess it is related to the GIL of the Python, and the project where Guido wants to 5x the python performance on 3.13 where they are making GIL optional. Which includes some breaking changes to many packages espacially those numerical ones and the ones uses c/c++ bindings.

Copy link

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 Feb 29, 2024
@abn abn removed the status/triage This issue needs to be triaged label Mar 2, 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
Development

No branches or pull requests

4 participants