-
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 cannot install Numpy 2.2.1 #10057
Comments
There is a lot of I tried it on the same system and |
@Secrus I tried that but encountered the same error. I also get this error in an ephemeral CI Pipeline (Azure DevOps) so makes me think local caching is not the issue. |
Try regenerating the lockfile with I am curious why poetry didn't try building from sdist. Edit: Also the checksum failures are odd as well, as mentioned by Secrus. The failure is due to none of the candidates described in the lockfile being viable and compatible with the runtime environment. |
@abn Same error: logs``` $ poetry cache clear PyPiAdd the --all option if you want to clear all PyPi caches Finding the necessary packages for the current system Package operations: 1 install, 0 updates, 0 removals
Stack trace: 5 ~/.local/share/pypoetry/venv/lib/python3.12/site-packages/poetry/installation/executor.py:274 in _execute_operation 4 ~/.local/share/pypoetry/venv/lib/python3.12/site-packages/poetry/installation/executor.py:385 in _do_execute_operation 3 ~/.local/share/pypoetry/venv/lib/python3.12/site-packages/poetry/installation/executor.py:509 in _execute_install 2 ~/.local/share/pypoetry/venv/lib/python3.12/site-packages/poetry/installation/executor.py:545 in _install 1 ~/.local/share/pypoetry/venv/lib/python3.12/site-packages/poetry/installation/executor.py:665 in _download RuntimeError Unable to find installation candidates for numpy (2.2.1) at ~/.local/share/pypoetry/venv/lib/python3.12/site-packages/poetry/installation/chooser.py:86 in choose_for Cannot install numpy.
|
Try |
@Secrus Same error unfortuantely. |
@pgoslatara |
@abn Yes, that works! What's actually happening here? And what is the solution, do we all have to regenerate our lock files or is there an underlying (non-blocking) Poetry issue that should be fixed? |
I think you hit one or more issues. But unfortunately all of these are something Poetry can only improve error messages on. As I mentioned before, the issue (the final one) is that Now, why the lock file did not contain a viable candidate. One issue is the checksums. For whatever reason the checksum in the lock did not match when Poetry tried to download the linked file. This could be because of numerous reasons.
Poetry did what it could do, tell you that it could not find a viable package. Granted, the message can be enriched :). I'd advise that the lock file be checked, when changed, in a clean environment in CI. |
@abn Thanks for the comprehensive reply!
I want to add that I believe we are already doing this. Locally we ran |
Do you have a recommendation on how we can solve this? To me this is more a "bad input" leading to "bad output" case. |
@abn Unfortunately I have nothing more useful than "Poetry should not generate a lock file that it cannot install". I know there's a huge amount of complexity behind that statement but as an end use of Poetry I expect it to perform this way. |
unless you can provide a way to reproduce "poetry generates a lock file that it cannot install" then I doubt there is any prospect of doing anything here |
@pgoslatara I understand wanting Poetry to "just work." However, it's unrealistic to expect Poetry to predict when a user provides invalid or incomplete data. That would be like expecting a calculator to know you meant to type "5" instead of "6" before giving you an answer. Poetry's job is to manage dependencies based on the information it's given. If that information is faulty, it can't magically fix it. As dimbleby said, unless there is a way we can reproduce this, there is nothing much we can do other than possibly improving the error message. If you can track down the change that broke it, maybe ask the developer who made the change to try to regenerate with their local cache. See if there is a delta with the new one. This could definitely show the users cache is corrupted or there is a version discrepancy. Additionally, regarding your CI. What I meant, is to check if there is a drift by comparing a regenerated version whenever there is a committed change if you want this level of safety. Even in that case if the cache used by the check job and your install jobs are different you could encounter issues. |
This changes introduces the use of `PoetryRuntimeError` that allows better error information propagation to facilitate improved ux for users encountering errors. Resolves: python-poetry#10057
This changes introduces the use of `PoetryRuntimeError` that allows better error information propagation to facilitate improved ux for users encountering errors. Resolves: python-poetry#10057
This changes introduces the use of `PoetryRuntimeError` that allows better error information propagation to facilitate improved ux for users encountering errors. Resolves: python-poetry#10057
This changes allows better error information propagation to facilitate improved ux for users encountering errors. Resolves: python-poetry#10057
This changes allows better error information propagation to facilitate improved ux for users encountering errors. Resolves: python-poetry#10057
This changes allows better error information propagation to facilitate improved ux for users encountering errors. Resolves: python-poetry#10057
This changes allows better error information propagation to facilitate improved ux for users encountering errors. Resolves: python-poetry#10057
Description
First reported here: numpy/numpy#28126
Poetry cannot install the latest version of
numpy
, 2.2.1. I also experience this issue with Poetry 2.0.1.Workarounds
None that I found.
Poetry Installation Method
install.python-poetry.org
Operating System
Ubuntu 24.04
Poetry Version
2.0.1
Poetry Configuration
Python Sysconfig
sysconfig.log
Example pyproject.toml
Poetry Runtime Logs
poetry-runtime.log
The text was updated successfully, but these errors were encountered: