python-poetry / python-poetry/poetry
Transient RuntimeError - unable to find installation candidates
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 34.3k
- Forks
- 2.5k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 30
Description
- Poetry version: 1.5.1
- Python version: 3.10.6
- OS version and name: Ubuntu 22.04.01
- pyproject.toml: https://gist.github.com/larsyencken/2e2be54d124764b5a379afe673879ad8
- 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 (
-vvvoption) and have included the output below.- Did not do this, error is transient
Issue
We experience rolling, transient runtime errors in our build pipelines where poetry cannot find installation candidates for a package.
To combat this, we currently run poetry install --no-ansi || poetry install --no-ansi, since a second poetry run usually works fine. Still we experience situations where a third attempt is required for a successful build.
Here is an example, where the in the first failure it cannot find candidates for pyasn1, then in the retry it cannot find idna.
We would welcome an overall fix, or recommendations for our pipeline that could make this happen less often.
+ poetry env use python3.9
Creating virtualenv owid-datautils in /var/lib/buildkite-agent/builds/etl-build-1-6/our-world-in-data/owid-datautils-unit-tests/lib/datautils/.venv
Using virtualenv: /var/lib/buildkite-agent/builds/etl-build-1-6/our-world-in-data/owid-datautils-unit-tests/lib/datautils/.venv
+ poetry install --no-ansi
Installing dependencies from lock file
Package operations: 150 installs, 1 update, 0 removals
• Installing pyasn1 (0.5.0)
• Installing six (1.16.0)
RuntimeError
Unable to find installation candidates for pyasn1 (0.5.0)
at /usr/local/lib/poetry/venv/lib/python3.10/site-packages/poetry/installation/chooser.py:76 in choose_for
72│
73│ links.append(link)
74│
75│ if not links:
→ 76│ raise RuntimeError(f"Unable to find installation candidates for {package}")
77│
78│ # Get the best link
79│ chosen = max(links, key=lambda link: self._sort_key(package, link))
80│
+ poetry install --no-ansi
Installing dependencies from lock file
Package operations: 149 installs, 1 update, 0 removals
• Installing pyasn1 (0.5.0)
• Installing asttokens (2.2.1)
• Installing cachetools (5.3.1)
• Installing certifi (2023.5.7)
• Installing charset-normalizer (3.1.0)
• Installing executing (1.2.0)
• Installing idna (3.4)
• Installing jmespath (1.0.1)
• Installing markupsafe (2.1.3)
• Installing mdurl (0.1.2)
• Installing packaging (23.1)
• Installing parso (0.8.3)
• Installing protobuf (4.23.3)
• Installing ptyprocess (0.7.0)
• Installing pure-eval (0.2.2)
• Installing pyasn1-modules (0.3.0)
• Installing pycparser (2.21)
• Installing pyparsing (3.1.0)
• Installing python-dateutil (2.8.2)
• Installing rsa (4.9)
• Installing smmap (5.0.0)
• Installing traitlets (5.9.0)
• Installing urllib3 (1.26.16)
• Installing wcwidth (0.2.6)
• Installing zipp (3.15.0)
RuntimeError
Unable to find installation candidates for idna (3.4)
at /usr/local/lib/poetry/venv/lib/python3.10/site-packages/poetry/installation/chooser.py:76 in choose_for
72│
73│ links.append(link)
74│
75│ if not links:
→ 76│ raise RuntimeError(f"Unable to find installation candidates for {package}")
77│
78│ # Get the best link
79│ chosen = max(links, key=lambda link: self._sort_key(package, link))
80│
🚨 Error: The command exited with status 1
user command error: exit status 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The traceback points to poetry/installation/chooser.py:76; start by reproducing the supplied project’s poetry install -vvv failure and comparing candidate lookup with a successful retry. Done means the transient installation failure is explained and addressed with regression coverage or documented pipeline guidance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100