Open larsyencken opened 1 year ago
I have the same problem with the embreex
package in macos ventura (apple m2) and poetry 1.5.1. Even running @larsyencken's poetry install --no-ansi || poetry install --no-ansi
does not work. Installing the same in Ubuntu 20.04 does not have any problem.
I'm in MacOS Sonoma with Poetry 1.7.0 and having the same problem. Weirdly, my env is using python 3.9.18, but the error shows that is trying to use python 3.11:
poetry --version
Poetry (version 1.7.0)
python --version
Python 3.9.18
poetry run python --version
Python 3.9.18
poetry install --with dev,test,codestyle
Installing dependencies from lock file
Package operations: 90 installs, 0 updates, 0 removals
• Installing thinc (8.0.17): Failed
RuntimeError
Unable to find installation candidates for thinc (8.0.17)
at ~/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/poetry/installation/chooser.py:73 in choose_for
69│
70│ links.append(link)
71│
72│ if not links:
→ 73│ raise RuntimeError(f"Unable to find installation candidates for {package}")
74│
75│ # Get the best link
76│ chosen = max(links, key=lambda link: self._sort_key(package, link))
77│
Cannot install thinc.
We are facing a similar transient RuntimeError in our github actions. Occasionally runs will fail during poetry install
step, and its not for the same packages, nor do we face the issue when running on the same environments locally (these are self-hosted runners)
$ poetry --version
Poetry (version 1.3.1)
$ python --version
Python 3.10.12
$ poetry run python --version
Python 3.10.12
CI logs can look like
...
Connection pool is full, discarding connection: pypi.org. Connection pool size: 10
RuntimeError
Unable to find installation candidates for matplotlib-inline (0.1.6)
at ~/.local/.../python-3.10.12/lib/python3.10/site-packages/poetry/installation/chooser.py:105 in choose_for
101│
102│ links.append(link)
103│
104│ if not links:
→ 105│ raise RuntimeError(f"Unable to find installation candidates for {package}")
106│
107│ # Get the best link
108│ chosen = max(links, key=lambda link: self._sort_key(package, link))
109│
RuntimeError
Unable to find installation candidates for prometheus-client (0.18.0)
at ~/.local/.../python-3.10.12/lib/python3.10/site-packages/poetry/installation/chooser.py:105 in choose_for
101│
102│ links.append(link)
103│
104│ if not links:
→ 105│ raise RuntimeError(f"Unable to find installation candidates for {package}")
106│
107│ # Get the best link
108│ chosen = max(links, key=lambda link: self._sort_key(package, link))
109│
added -vvv and got these logs:
• Installing referencing (0.30.2)
• Installing six (1.16.0)
Stack trace:
5 ~/.local/.../python-3.10.12/lib/python3.10/site-packages/poetry/installation/executor.py:263 in _execute_operation
261│
262│ try:
→ 263│ result = self._do_execute_operation(operation)
264│ except EnvCommandError as e:
265│ if e.e.returncode == -2:
4 ~/.local/.../python-3.10.12/lib/python3.10/site-packages/poetry/installation/executor.py:334 in _do_execute_operation
332│ return 0
333│
→ 334│ result: int = getattr(self, f"_execute_{method}")(operation)
335│
336│ if result != 0:
3 ~/.local/.../python-3.10.12/lib/python3.10/site-packages/poetry/installation/executor.py:454 in _execute_install
452│
453│ def _execute_install(self, operation: Install | Update) -> int:
→ 454│ status_code = self._install(operation)
455│
456│ self._save_url_reference(operation)
2 ~/.local/.../python-3.10.12/lib/python3.10/site-packages/poetry/installation/executor.py:488 in _install
486│ archive = self._download_link(operation, Link(package.source_url))
487│ else:
→ 488│ archive = self._download(operation)
489│
490│ operation_message = self.get_operation_message(operation)
1 ~/.local/.../python-3.10.12/lib/python3.10/site-packages/poetry/installation/executor.py:626 in _download
624│
625│ def _download(self, operation: Install | Update) -> Path:
→ 626│ link = self._chooser.choose_for(operation.package)
627│
628│ if link.yanked:
RuntimeError
Unable to find installation candidates for six (1.16.0)
at ~/.local/.../python-3.10.12/lib/python3.10/site-packages/poetry/installation/chooser.py:105 in choose_for
101│
102│ links.append(link)
103│
104│ if not links:
→ 105│ raise RuntimeError(f"Unable to find installation candidates for {package}")
106│
107│ # Get the best link
108│ chosen = max(links, key=lambda link: self._sort_key(package, link))
109│
I had the same problem with private package, it ended up that I was building wheel for ARM that my local env is running on, but CI runs on x86_64 and it was missing binary for x86_64. After adding it to the published package I was able to successfully install it in CI. Maybe those packages that you're trying to install have the same problem - lacking of target architecture.
lxml
4.9.4 started causing consistent failures in my CI pipeline like this today, using Python 3.12 and Poetry 1.7.1. I've never seen this before, but install now reliably fails on my CI runner (with the only change to poetry.lock being updating from 4.9.3 to 4.9.4) and succeeds on my local machine. Both systems are x86_64 Linux.
When run with -vvv
the output looks the same as https://github.com/python-poetry/poetry/issues/8139#issuecomment-1812982525; since Chooser.choose_for
logs debug messages for ignored links and there aren't any Skipping wheel
or Skipping distribution
messages visible, it seems like either PyPI is failing to return any links for the package, or Poetry's debug logging is simply not working correctly.
Things that I believe this failure is not, which I've seen some discussions of similar issues suggest:
poetry install --no-cache
still fails--ansi
or --no-ansi
Turns out my issue was an architecture mismatch, but seemingly caused by Poetry.lock not reflecting what was available on PyPI; I think because the lockfile was updated before the full set of wheels was available on PyPI. Updating the lockfile again added a bunch more wheels, including a manylinux_x86_64
wheel that was previously missing.
Seeing exactly the same thing happen with:
$ poetry --version
Poetry (version 1.8.2)
$ poetry run python --version
Python 3.10.12
Example:
Unable to find installation candidates for multidict (6.0.4)
at ~/.pyenv/versions/3.10.12/lib/python3.10/site-packages/poetry/installation/chooser.py:74 in choose_for
70│
71│ links.append(link)
72│
73│ if not links:
→ 74│ raise RuntimeError(f"Unable to find installation candidates for {package}")
75│
76│ # Get the best link
77│ chosen = max(links, key=lambda link: self._sort_key(package, link))
78│
Cannot install multidict.
However this is not the case when I run with the combination of poetry v1.5.1 and python 3.10.12
I believe I'm also experiencing this error within my ci tests -- link
Poetry fails to find an installation candidate on specific python versions, however I'm able to immediately ssh into the runner and pip
install the dependency with no issues.
Same issue here: Unable to find installation candidates for onnxruntime (1.18.0)
. Weirdly it only happens when running within my Dockerfile. Is this an issue related to timeouts to the package sources during builds?
Facing the exact same error with nltk now, only within my Dockerfile. Is there any update on this?
***Update: Seemed to be fixed after updating nltk to 3.9.1
facing the same issue
same on mac m2
poetry --version
Poetry (version 1.7.1)
python --version
Python 3.11.9
-vvv
option) and have included the output below.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 findidna
.We would welcome an overall fix, or recommendations for our pipeline that could make this happen less often.