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 (-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?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:17
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
lambda-sciencecommented, Mar 10, 2022

Same error for another package, not sure why

• Installing kaleido (0.2.1.post1): Failed

  RuntimeError

  Unable to find installation candidates for kaleido (0.2.1.post1)

EDIT: Downgrading Kaleido to 0.2.1 fixed it.

5reactions
cereblancocommented, Dec 12, 2020

This is how I setup private pypi

  1. Edit pyproject.toml
[[tool.poetry.source]]
name = "myprivate_pypi"
url = "https://pypi.myprivate_pypi.com/simple/"
  1. At terminal, add poetry config credentials for private_pypi poetry config http-basic.myprivate_pypi <username> <password>

  2. Update lock with --no-update poetry lock --no-update

  3. Run install or Add your library that is found at private pypi

poetry install or poetry add <my-package-found-at-myprivate_pypi>

Let me know if it fixes the issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Unable to find installation candidates" in poetry trying to ...
Had a dependency to a repository using an authentication token which were expired. Updating auth credentials fixed this.
Read more >
Poetry 1.1.4 - "Unable to find installation candidates" when ...
Poetry 1.1.4 - "Unable to find installation candidates" when using a private secondary repository.
Read more >
Repositories | Documentation | Poetry - Python dependency ...
Poetry can fetch and install package dependencies from public or private custom repositories that implement the simple repository API as described in PEP...
Read more >
Why you should use Poetry instead of Pip or Conda for Python ...
The secondary parameter basically tells Poetry to search for and install libraries from PyPI first, and only go to the private repository if ......
Read more >
Python Dependency Management and Packaging Made Easy
You can also install Poetry for a git repository by using the --git option: ... using the now deprecated get-poetry.py installer will not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found