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.

Poetry refuses to install package with correct hash

See original GitHub issue

Issue

Poetry refuses to install a package even though the checksum is correct. Looking at the output it seems as if the cheksum stored in the lock file is md5 and the checksum used during installation is sha256.

Both sha256:3ae5020d5eddabcb57db9211e3f1a46ebafa28cb31cdeb4a497189041757bb7b and md5:75dbe554e7838a35e3a5836887cf9efc are valid checksums for this package according to our index (artifactory).

❯ poetry install
Installing dependencies from lock file

Package operations: 1 install, 0 updates, 0 removals

  • Installing axis-json-log-formatter (0.1.0): Failed

  RuntimeError

  Retrieved digest for link axis_json_log_formatter-0.1.0.tar.gz(sha256:3ae5020d5eddabcb57db9211e3f1a46ebafa28cb31cdeb4a497189041757bb7b) not in poetry.lock metadata ['md5:75dbe554e7838a35e3a5836887cf9efc']

  at ~/.poetry/lib/poetry/installation/chooser.py:115 in _get_links
      111│
      112│         if links and not selected_links:
      113│             raise RuntimeError(
      114│                 "Retrieved digest for link {}({}) not in poetry.lock metadata {}".format(
    → 115│                     link.filename, h, hashes
      116│                 )
      117│             )
      118│
      119│         return selected_links

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:111
  • Comments:92 (17 by maintainers)

github_iconTop GitHub Comments

37reactions
dimblebycommented, Aug 31, 2022

I dunno how this thread has got so long: poetry insists on sha256 hashes, some repositories only provide md5 hashes, these don’t play nice together. The end.

I am not interested in this issue, please don’t tag me again.

30reactions
elielliscommented, Apr 7, 2022

For what it’s worth and if it helps anyone fix or reproduce the issue, I encountered this bug today.

I ran poetry install on quite a hefty project with lots of dependencies. As Poetry was downloading, my internet dropped and the command froze with scipy stuck at Downloading XX%. I killed the console and ran the command again to encounter the RuntimeError Invalid hashes for scipy.

I tried most of the above solutions and others, but what finally cut it for me was deleting:

~/.cache/pypoetry/cache/
~/.cache/pypoetry/artifacts/

as mentioned by @estebansolo

worked for me!

for macOS users this would be ~/Library/Caches/pypoetry/cache and ~/Library/Caches/pypoetry/artifacts

had a private Artifactory dependency that was failing with hash issues and after rm -ring the above directories, everything installed just fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python poetry install failure - invalid hashes - Stack Overflow
There are several issue reports about invalid hashes. One common cause is running multiple Poetry instances simultaneously; ...
Read more >
Poetry Advance - Python Biella Group
Poetry Advance. Poetry is the most sofisticated Python dependency system available (up to 2020). It allows you to go beyond simple dependency management, ......
Read more >
Announcing Poetry 1.2.0 | Blog
Poetry now supports discovering and installing dependencies from the 'single page' style of repository. Some widely-consumed package are not ...
Read more >
pip install poetry==0.3.0 - PyPI
However it will not be enforced and you remain free to follow another specification. python-version. A list of Python versions for which the...
Read more >
Insights into how poetry.lock works cross platform - Packaging
Are there specific instances or examples of packages where poetry ... and can be installed on multiple sys_platform and python versions.
Read more >

github_iconTop Related Medium Post

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