-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 ignores the Python version specified in the pyproject.toml file #9779
Comments
I guess that's not what you meant, but it is what you asked for and poetry is behaving correctly. |
So that’s probably a usability issue since it should be consistent with Basically in either case I’d expect it to either use the specified version or fail, not to use the version Poetry was compiled with. I noticed this because it broke a large number of projects due to a common dependency which doesn’t yet support 3.13. |
I can't tell what you are reporting, all I know is that you are now telling us that it is something different than what you reported.
But it is failing, right? Or is what you showed not what you are trying to show? |
There are two issues: one is that the The original one is simply that while the documentation says that things like cadams@ /var/folders/hs/qvpck5vn/T/tmp.ytfDY1nsxc> poetry init --python="^3.9.0" -n
cadams@ /var/folders/hs/qvpck5vn/T/tmp.e25AD4Ky3O> grep python pyproject.toml
python = "^3.9.0"
cadams@ /var/folders/hs/qvpck5vn/T/tmp.ytfDY1nsxc> poetry install
Creating virtualenv tmp-ytfdy1nsxc-JtgGK1RE-py3.13 in /Users/cadams/Library/Caches/pypoetry/virtualenvs If I use If I use the standard Python version specifiers from PEP-440 like cadams@ /var/folders/hs/qvpck5vn/T/tmp.CzPT8laB7C> poetry init --python=">=3.9.0 <3.10" -n
cadams@ /var/folders/hs/qvpck5vn/T/tmp.CzPT8laB7C> poetry install
The currently activated Python version 3.13.0 is not supported by the project (>=3.9.0 <3.10).
Trying to find and use a compatible version.
Using python3.9 (3.9.20) |
Hey @acdha,
improvements to the docs are always welcome. For me the difference is stated out:
and
So the first is talking about versions and the later about the executable. If you find that we can make it more clear, feel free to submit a PR 😃 fin swimmer |
The first part is correct but the second is misleading because it technically accepts both. As written, you'd think you'd need to use it like |
Description
Poetry uses the version of Python which was used to install Poetry no matter what the
pyproject.toml
file is configured to use.Workarounds
poetry env use <VERSION>
can be used to create the appropriate version environment first. Since Python 3.13 was just released, this breaks many previously-working configurations.Poetry Installation Method
system package manager (eg: dnf, apt etc.)
Operating System
macOS
Poetry Version
Poetry (version 1.8.4)
Poetry Configuration
Python Sysconfig
Example pyproject.toml
Poetry Runtime Logs
The text was updated successfully, but these errors were encountered: