Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Can't add packages with python 3.11-dev #8663

Closed
4 tasks done
hros opened this issue Nov 13, 2023 · 6 comments
Closed
4 tasks done

Can't add packages with python 3.11-dev #8663

hros opened this issue Nov 13, 2023 · 6 comments
Labels
kind/bug Something isn't working as expected

Comments

@hros
Copy link

hros commented Nov 13, 2023

  • 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

can't add packages with poetry using when the python version is specified by pyenv local 3.11-dev (the dev version is currently set to 3.11.4)
The steps are:

  1. create a new directory and cd into the directory
  2. pyenv local 3.11-dev
  3. poetry init using default settings, changing Compatible Python versions from ^3.10 to ^3.11
  4. poetry shell
  5. poetry add numpy, returns with message:
Using version ^1.26.2 for numpy

Updating dependencies
Resolving dependencies... (0.1s)

Invalid PEP 440 version: '3.11.4+'
  1. trying the same with another package: poetry add scipy, returns with message:
Using version ^1.11.3 for scipy

Updating dependencies
Resolving dependencies... (0.0s)

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

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

  • Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties

    For scipy, a possible solution would be to set the `python` property to ">=3.11,<3.13"

    https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,
    https://python-poetry.org/docs/dependency-specification/#using-environment-markers
@hros hros added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Nov 13, 2023
@dimbleby
Copy link
Contributor

duplicate #6925

@hros
Copy link
Author

hros commented Nov 13, 2023

thanks!!
that solved the issue with numpy (the python version no longer has a +, though it is a shame that I can't use the dev channel)
the other issue, item 6 installing scipy, still does not work

The message points to the docs, and suggests

For scipy, a possible solution would be to set the python property to ">=3.11,<3.13"

I couldn't get this to work. What is the proper way to get such packages to work
moreover, the initial message is unclear: "scipy requires Python <3.13,>=3.9, so it will not be satisfied for Python >=3.13,<4.0" since I'm using Python 3.11.4

@dimbleby
Copy link
Contributor

please read the faq

@hros
Copy link
Author

hros commented Nov 13, 2023

thanks!
the faq did not help
I was able to find a solution in a blog

I modified the pyproject.toml file:

[tool.poetry.dependencies]
python = ">=3.11,<3.12"

Initially, scipy asked for <3.13, another package I installed raised an error asking for stricter version bounds

@dimbleby
Copy link
Contributor

please close

@hros hros closed this as completed Nov 13, 2023
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
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

3 participants