21

I have just installed poetry on a windows 10 machine using the new install-poetry.py script. I have just converted my python application dependency management to pyproject.toml with poetry. It works for most of my dependencies, but fails for the genicam package, with the above Unable to find installation candidates error message. Installing that package with pip does work. How do I debug such issues? I tried running poetry install -vvv, but all I get is the same stack-trace of poetry's internals in verbose form, nothing useful added to the output of the short-form (in particular no indexes or urls it tried and failed):

Package operations: 1 install, 0 updates, 0 removals

  • Installing genicam (1.1.0)

  RuntimeError

  Unable to find installation candidates for genicam (1.1.0)

  at ~\AppData\Roaming\pypoetry\venv\lib\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'm using poetry version 1.1.13 on python 3.8.10 on windows 10 (python 3.8 is the latest supported by genicam - it's a closed source package managed by the GenICam consortium, and they have a ridiculous release process; somehow they need a committee voting before they can release a new package - end rant).

4
  • 5
    Try cleaning the cache by poetry cache clear --all pypi and run poetry install again. Commented Apr 9, 2022 at 5:29
  • 3
    poetry cache cleardidn't help. My problem was in fact that I my pyproject.toml specified python = "^3.8" which was resolved by poetry to select python 3.9; the only one it found. Fixing did lead to an issue where poetry doesn't use pyenv python even when it was activated, when poetry is installed using the new install-poetry.py. The original question still stands though: How would I debug the issue (i.e. if poetry had told me it uses python 3.9, I would have been much quicker here). Commented Apr 9, 2022 at 19:29
  • poetry env info should show which Python is used for the virtual environment. Commented Nov 26, 2022 at 11:22
  • try poetry cache clear --all pypi and also poetry config installer.max-workers 1 Commented Dec 30, 2023 at 12:16

3 Answers 3

16

Had a dependency to a repository using an authentication token which were expired. Updating auth credentials fixed this.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you! That was not a very nice error message for sure.
How to fix the credentials issue, any more details? Thanks
4

Similar to Jakob Kristensen's answer (thanks for the pointer), in my case the access tokens had expired. Here's a longer winded answer on how I solved it.


The Access Tokens to the desired repositories had expired:

Poetry saves the authentication method in the poetry.toml file:

  • Update the access tokens with the poetry config http-basic.$SOURCENAME $USERNAME $PASSWORD command.
    • Note: here $SOURCENAME refers to how the source was named in the pyproject.toml file and not to the name of the repository!
  • See the poetry documentation on Configuring Credentials for more information.

If the issue is occurring in Gitlab-CI, you may use poetry config http-basic.$SOURCENAME gitlab-ci-token "${CI_JOB_TOKEN}".

Comments

0

Removing the entry [http-basic.artifactory] from ~/.config/pypoetry/auth.toml fixed the issue for me.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.