poetry: Unable to find installation candidates (protobuf), but can install via pip

  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate. (similar issues found, but which are supposed to be solved)

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: macOS 12.3.1 (Darwin Kernel Version 21.4.0)

  • Poetry version: 1.1.13

  • Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/esciara/857729c278b4de37a6da82e7f62b0a3f

Issue

Same kind of issue than #3621 . All other related issue I found where closed with a fix supposedly in place.

Running a poetry install with the pyproject.toml file in the gist reproduces the problem. Installation works fine with a pip install protobuf.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

The reason why no wheel was found during install was because the protobuf-3.20.1-py2.py3-none-any.whl was skipped because of missing hash in the lock file.

Seen with @abn : it was a cache issue that has been resolved by:

  • clearing the cache by running the following:
    poetry cache clear --all pypi
    poetry cache clear --all PyPI
    
  • deleting the poetry.lock file
  • running another poetry install

Here is the sequence of what might have happened:

  1. Bad cache for whatever reason
  2. Lockfile lists the old set of hashes from the cache for protobuf.
  3. Installer does not find the hash and skips over the link for universal wheel.
  4. Since no compatible wheel remained install failed.

It is to be noted that the first time this happened, protobuf 3.20.1 was only 12 hours old. Has the library been republished with the same version? The cache is probably not invalidated in this scenario. @abn wonders whethere Poetry should use the serial value from PyPI to invalidate artifact caches.

@abn feel free to comment or to ask to correct.