Poetry 1.1.4 - "Unable to find installation candidates" when using a private secondary repository
See original GitHub issue- 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 (
-vvvoption).
- 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?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:17
- Comments:12 (1 by maintainers)
Top Related StackOverflow Question
Same error for another package, not sure why
EDIT: Downgrading Kaleido to 0.2.1 fixed it.
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-updateRun install or Add your library that is found at private pypi
poetry installorpoetry add <my-package-found-at-myprivate_pypi>Let me know if it fixes the issue