question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fail to add package where the latest release contains no installable wheel

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).
  • Ubuntu 20.04.2 LTS:
  • 1.1.6:
  • New Project:

Issue

When I create a new project, I’m unable to add the package kaleido. (0.2.1.post currently)

franz@desktop:~$ poetry new start
Created package start in start

franz@desktop:~$ poetry add kaleido
Creating virtualenv start in /home/franz/start/.venv
Using version ^0.2.1 for kaleido

Updating dependencies
Resolving dependencies... (0.9s)

Writing lock file

Package operations: 9 installs, 0 updates, 0 removals

  • Installing pyparsing (2.4.7)
  • Installing attrs (21.1.0)
  • Installing more-itertools (8.7.0)
  • Installing packaging (20.9)
  • Installing pluggy (0.13.1)
  • Installing py (1.10.0)
  • Installing wcwidth (0.2.5)
  • Installing kaleido (0.2.1.post1): Failed

  RuntimeError

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

  at ~/.poetry/lib/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

  • Installing pytest (5.4.3)

Failed to add packages, reverting the pyproject.toml file to its original content.

franz@desktop:~$ poetry add kaleido -vvv
Using virtualenv: /home/franz/start/.venv
PyPI: 9 packages found for kaleido *
Using version ^0.2.1 for kaleido

Updating dependencies
Resolving dependencies...
   1: fact: start is 0.1.0
   1: derived: start
   1: fact: start depends on kaleido (^0.2.1)
   1: fact: start depends on pytest (^5.2)
   1: fact: start depends on pytest (^5.2)
   1: selecting start (0.1.0)
   1: derived: pytest (>=5.2,<6.0)
   1: derived: kaleido (>=0.2.1,<0.3.0)
   1: fact: pytest (5.4.3) depends on py (>=1.5.0)
   1: fact: pytest (5.4.3) depends on packaging (*)
   1: fact: pytest (5.4.3) depends on attrs (>=17.4.0)
   1: fact: pytest (5.4.3) depends on more-itertools (>=4.0.0)
   1: fact: pytest (5.4.3) depends on pluggy (>=0.12,<1.0)
   1: fact: pytest (5.4.3) depends on wcwidth (*)
   1: fact: pytest (5.4.3) depends on atomicwrites (>=1.0)
   1: fact: pytest (5.4.3) depends on colorama (*)
   1: selecting pytest (5.4.3)
   1: derived: colorama
   1: derived: atomicwrites (>=1.0)
   1: derived: wcwidth
   1: derived: pluggy (>=0.12,<1.0)
   1: derived: more-itertools (>=4.0.0)
   1: derived: attrs (>=17.4.0)
   1: derived: packaging
   1: derived: py (>=1.5.0)
PyPI: 2 packages found for kaleido >=0.2.1,<0.3.0
   1: selecting kaleido (0.2.1.post1)
   1: selecting wcwidth (0.2.5)
   1: selecting pluggy (0.13.1)
   1: selecting more-itertools (8.7.0)
   1: selecting attrs (21.1.0)
   1: fact: packaging (20.9) depends on pyparsing (>=2.0.2)
   1: selecting packaging (20.9)
   1: derived: pyparsing (>=2.0.2)
   1: selecting py (1.10.0)
   1: selecting pyparsing (2.4.7)
   1: selecting colorama (0.4.4)
   1: selecting atomicwrites (1.4.0)
   1: Version solving took 0.032 seconds.
   1: Tried 1 solutions.

Finding the necessary packages for the current system

Package operations: 1 install, 0 updates, 0 removals, 10 skipped

  • Removing atomicwrites (1.4.0): Pending...
  • Removing atomicwrites (1.4.0): Skipped for the following reason: Not currently installed
  • Removing colorama (0.4.4): Pending...
  • Removing colorama (0.4.4): Skipped for the following reason: Not currently installed
  • Installing pyparsing (2.4.7): Pending...
  • Installing pyparsing (2.4.7): Skipped for the following reason: Already installed
  • Installing attrs (21.1.0): Pending...
  • Installing attrs (21.1.0): Skipped for the following reason: Already installed
  • Installing more-itertools (8.7.0): Pending...
  • Installing more-itertools (8.7.0): Skipped for the following reason: Already installed
  • Installing packaging (20.9): Pending...
  • Installing packaging (20.9): Skipped for the following reason: Already installed
  • Installing pluggy (0.13.1): Pending...
  • Installing pluggy (0.13.1): Skipped for the following reason: Already installed
  • Installing py (1.10.0): Pending...
  • Installing py (1.10.0): Skipped for the following reason: Already installed
  • Installing wcwidth (0.2.5): Pending...
  • Installing wcwidth (0.2.5): Skipped for the following reason: Already installed
  • Installing kaleido (0.2.1.post1): Pending...
  • Installing kaleido (0.2.1.post1): Failed

  RuntimeError

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

  at ~/.poetry/lib/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

  • Installing pytest (5.4.3): Pending...
  • Installing pytest (5.4.3): Skipped for the following reason: Already installed

Failed to add packages, reverting the pyproject.toml file to its original content.

I’m not sure if it’s about the semver incompatible versioning (0.2.1.post) or if there’s any other issue. Installing via pip works fine, however pip installs 0.2.1 (without .post)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
FranzForstmayrcommented, Dec 20, 2021

I just digged into this issue, and found out that the ‘Env’ instance is not taken into account when resolving dependencies. That’s why 0.2.1.post1 is choosen, although there’s no installation candidate.

I tried to pass the environment downto PyPiRepository.find_packages but the class is instantiated multiple times and would need lot’s of changes, because the environment is not accessible from everywhere.

Maybe one of the core-devs can answer, why env is not accessible from anywhere, maybe even as a singleton?

1reaction
abncommented, May 7, 2021

Can you try with poetry from master? We have a few improvements there for PEP440 version parsing.

You can use pipx to install from master like so.

pipx install --force --suffix=@master 'poetry @ git+https://github.com/python-poetry/poetry.git@master'
poetry@master --version
Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues - GitHub
Unable to install wheel containing .data/headers using from non-writable pip installation into writable --prefix #8521.
Read more >
DEPRECATION Error : 'wheel' package is not installed
We are using python 3.7.12. We have tried to install wheel package as the part of deployment with no luck. Do we need...
Read more >
How to install, download and build Python wheels - ActiveState
Python Install Wheel. Open source Python packages can be installed from Source Distributions (sdist) or Wheels (whl).
Read more >
Optimize pip install with wheels - Roman Imankulov
Make sure you install all binary packages from wheels. ... Make sure you have the latest version of pip, setuptools, and wheel.
Read more >
Could not install packages due to an OSError [FIX] - YouTube
This video we'll talk about how to fix the following error : “Could not install packages due to an OSError”. I had this...
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