poetry: Poetry 1.1.4 - "Unable to find installation candidates" when using a private secondary repository
- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: MacOS Catalina (10.15.4)
- Poetry version: 1.1.4
Issue
I have a project that uses a private package.
But for some reason, when using poetry 1.1.4, the poetry.lock
file generated on MacOS is in broken.
I receive the following error:
Installing click (7.1.2): Failed
RuntimeError
Unable to find installation candidates for click (7.1.2)
~/venvs/poetry/lib/python3.8/site-packages/poetry/installation/chooser.py:72 in choose_for
68│
69│ links.append(link)
70│
71│ if not links:
→ 72│ raise RuntimeError(
73│ "Unable to find installation candidates for {}".format(package)
74│ )
75│
76│ # Get the best link
I’ve reproduced this issue with a simple pyproject.toml
that looks like this:
[tool.poetry]
name = "check"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
[[tool.poetry.source]]
name = "private-repo"
url = "....."
secondary = true
[tool.poetry.dependencies]
python = "^3.6.1"
click = "^7.1.2"
[tool.poetry.dev-dependencies]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
The poetry.lock
file:
[[package]]
name = "click"
version = "7.1.2"
description = "Composable command line interface toolkit"
category = "main"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
[package.source]
type = "legacy"
url = "....."
reference = "private-repo"
[metadata]
lock-version = "1.1"
python-versions = "^3.6.1"
content-hash = "1e4a57826cb5553aa07a9ba3b0b9e101193b781d7ddd2d41a08f27a8fa25ac4e"
[metadata.files]
click = [
{file = "click-7.1.2-py2.py3-none-any.whl", hash = "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc"},
{file = "click-7.1.2.tar.gz", hash = "sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a"},
]
I’ve found out that when using poetry==1.1.3
, the lock file generated is a little different.
It doesn’t contain the [package.source]
section on packages from PyPI
(With this lock file, the poetry install
command works with no problem)
[[package]]
name = "click"
version = "7.1.2"
description = "Composable command line interface toolkit"
category = "main"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
[metadata]
lock-version = "1.1"
python-versions = "^3.6.1"
content-hash = "1e4a57826cb5553aa07a9ba3b0b9e101193b781d7ddd2d41a08f27a8fa25ac4e"
[metadata.files]
click = [
{file = "click-7.1.2-py2.py3-none-any.whl", hash = "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc"},
{file = "click-7.1.2.tar.gz", hash = "sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a"},
]
Also, I tried to reproduce the issue on Ubuntu, but poetry==1.1.4
works with no problem there (was running my tests from a docker container)
I’ve seen this issue: https://github.com/python-poetry/poetry/issues/3151 but I don’t think it’s related
Is this a bug?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 22
- Comments: 16 (3 by maintainers)
Commits related to this issue
- add pypi explicitely for https://github.com/python-poetry/poetry/issues/3456 — committed to guillp/requests_oauth2client by deleted user 2 years ago
This is how I setup private pypi
At terminal, add poetry config credentials for private_pypi
poetry config http-basic.myprivate_pypi <username> <password>
Update lock with --no-update
poetry lock --no-update
Run install or Add your library that is found at private pypi
poetry install
orpoetry add <my-package-found-at-myprivate_pypi>
Let me know if it fixes the issue
I get a similar issue with
Poetry 1.2
Same error for another package, not sure why
EDIT: Downgrading Kaleido to 0.2.1 fixed it.
@lambda-science just encountered the error for kaleido. Thank you.
==> poetry add kaleido@0.2.1 worked.
I got this working by setting default on the public pypi:
Tried using with
secondary = <flag>
like this without luck:I just ran into this
Unable to find installation candidates for jupyter-client (7.1.0)
version info: py3.9, Poetry version 1.1.6
Running
poetry update
seemed to fix it. But the error is not very informative.This doesn’t work for me:
Error message:
My pyproject.toml:
I got a similar error with poetry 1.3.2 in CI/CD for the regex package:
I solved it by removing the virtual environment (with python 3.9.16) and clearing the caches.
Is there any way we can get a dependency
kaleido = "^0.2"
working?I ran into this (poetry 1.1.2) when running
poetry update
and a new version of an inherited dependency had been released only a few minutes earlier. The update / install worked fine, but a CI build kept failing. If I removed the dependency on my local venv, I too would get this error. Installing withpip
worked fine.I tried running
poetry update
and it would complete without error, butpoetry install
failed to install some dependency. I also cleared the poetry cache with no luck.The only thing that fixed this for me was to delete the
poetry.lock
file, and re-runpoetry update
. This should have rebuilt the samepoetry.lock
file as I understand it, it did not. The result was it fixed something about the known packages for this inherited dependency, andpoetry install
works locally and in CI.Looks like https://github.com/python-poetry/poetry/pull/3406 solves it. Closing this issue for now.