{"id":1129,"hash":"4321c829b3bfff5b531b00fed66d1f598d0cdaf1fd627f55245aaa4b4b0d232a","pattern":"Python poetry install failure - invalid hashes","full_message":"I'm unsure exactly what information / context to provide with this post in order for it to be\nproperly answered - so if I can add more information please let me know.\n\nWhilst trying to install a package I've had an error message as follows:\n\n  Invalid hashes (sha256:01d6b62184e55367ce7d770bd87d97a6cfaf783ff7ba8328e7473a339fe19807) for numpy (1.22.2)\n\nI don't know how to go about troubleshooting this problem.\n\npoetry --version\n(install-check-clU745_7-py3.8) ➜  install_check poetry --version\nPoetry version 1.1.12\n\npoetry env info\nOutput of poetry env info:\n\n(install-check-clU745_7-py3.8) ➜  install_check poetry env info\n\nVirtualenv\nPython:         3.8.12\nImplementation: CPython\nPath:           /Users/user_name/Library/Caches/pypoetry/virtualenvs/install-check-clU745_7-py3.8\nValid:          True\n\nSystem\nPlatform: darwin\nOS:       posix\nPython:   /Users/user_name/.pyenv/versions/3.8.12\n\npyproject.toml\npyproject.toml config:\n\n(install-check-clU745_7-py3.8) ➜  install_check cat pyproject.toml\n[tool.poetry]\nname = \"install_check\"\nversion = \"0.1.0\"\ndescription = \"\"\nauthors = [\"user_name <user_name@email_add.com>\"]\n\n[tool.poetry.dependencies]\npython = \"^3.8\"\n\n[tool.poetry.dev-dependencies]\npytest = \"^5.2\"\n\n[build-system]\nrequires = [\"poetry-core>=1.0.0\"]\nbuild-backend = \"poetry.core.masonry.api\"\n\nSteps to reproduce\nHere is an attempt to clearly outline a reproduction of this problem:\n\npython --version\n    Python 3.8.12\n\nwhich python\n    /Users/user_name/.pyenv/shims/python\n\npoetry new install_check\n    Created package install_check in install_check\n\ncd install_check\n\ncat pyproject.toml| grep python\n    python = \"^3.7\"\n\n# update pyproject.toml to 3.8 instead of 3.7.\n\ncat pyproject.toml | grep python\n    python = \"^3.8\"\n\npython --version\n    Python 3.8.12\n\npoetry env use python3.8\n\nwhich python3.8\n    /Users/user_name/.pyenv/shims/python3.8\n\npoetry env use python3.8\n\npoetry install\n    Updating dependencies\n    Resolving dependencies... (5.0s)\n\n    Writing lock file\n\n    Package operations: 8 installs, 0 updates, 0 removals\n\n    • Installing pyparsing (3.0.7)\n    • Installing attrs (21.4.0)\n    • Installing more-itertools (8.12.0)\n    • Installing packaging (21.3)\n    • Installing pluggy (0.13.1)\n    • Installing py (1.11.0)\n    • Installing wcwidth (0.2.5)\n    • Installing pytest (5.4.3)\n\n    Installing the current project: install_check (0.1.0)\n\nFollowing this, after leaving and revisiting the directory to activate the env, I have:\n\n(install-check-clU745_7-py3.8) ➜  install_check which python\n/Users/user_name/Library/Caches/pypoetry/virtualenvs/install-check-clU745_7-py3.8/bin/python\n(install-check-clU745_7-py3.8) ➜  install_check python --version\nPython 3.8.12\n\nTrying to add pandas then gives the following error:\n\n(install-check-clU745_7-py3.8) ➜  install_check poetry add pandas\nUsing version ^1.4.0 for pandas\n\nUpdating dependencies\nResolving dependencies... (2.3s)\n\nWriting lock file\n\nPackage operations: 5 installs, 0 updates, 0 removals\n\n  • Installing six (1.16.0)\n  • Installing numpy (1.22.2): Failed\n\n  RuntimeError\n\n  Invalid hashes (sha256:01d6b62184e55367ce7d770bd87d97a6cfaf783ff7ba8328e7473a339fe19807) for numpy (1.22.2) using archive numpy-1.22.2-cp38-cp38-macosx_10_14_x86_64.whl. Expected one of sha256:03ae5850619abb34a879d5f2d4bb4dcd025d6d8fb72f5e461dae84edccfe129f, sha256:076aee5a3763d41da6bef9565fdf3cb987606f567cd8b104aded2b38b7b47abf, sha256:0b536b6840e84c1c6a410f3a5aa727821e6108f3454d81a5cd5900999ef04f89, sha256:15efb7b93806d438e3bc590ca8ef2f953b0ce4f86f337ef4559d31ec6cf9d7dd, sha256:168259b1b184aa83a514f307352c25c56af111c269ffc109d9704e81f72e764b, sha256:2638389562bda1635b564490d76713695ff497242a83d9b684d27bb4a6cc9d7a, sha256:3556c5550de40027d3121ebbb170f61bbe19eb639c7ad0c7b482cd9b560cd23b, sha256:4a176959b6e7e00b5a0d6f549a479f869829bfd8150282c590deee6d099bbb6e, sha256:515a8b6edbb904594685da6e176ac9fbea8f73a5ebae947281de6613e27f1956, sha256:55535c7c2f61e2b2fc817c5cbe1af7cb907c7f011e46ae0a52caa4be1f19afe2, sha256:59153979d60f5bfe9e4c00e401e24dfe0469ef8da6d68247439d3278f30a180f, sha256:60cb8e5933193a3cc2912ee29ca331e9c15b2da034f76159b7abc520b3d1233a, sha256:6767ad399e9327bfdbaa40871be4254d1995f4a3ca3806127f10cec778bd9896, sha256:76a4f9bce0278becc2da7da3b8ef854bed41a991f4226911a24a9711baad672c, sha256:8cf33634b60c9cef346663a222d9841d3bbbc0a2f00221d6bcfd0d993d5543f6, sha256:94dd11d9f13ea1be17bac39c1942f527cbf7065f94953cf62dfe805653da2f8f, sha256:aafa46b5a39a27aca566198d3312fb3bde95ce9677085efd02c86f7ef6be4ec7, sha256:badca914580eb46385e7f7e4e426fea6de0a37b9e06bec252e481ae7ec287082, sha256:d76a26c5118c4d96e264acc9e3242d72e1a2b92e739807b3b69d8d47684b6677.\n\n  at ~/Library/Application Support/pypoetry/venv/lib/python3.7/site-packages/poetry/installation/executor.py:632 in _download_link\n      628│                     \"Invalid hashes ({}) for {} using archive {}. Expected one of {}.\".format(\n      629│                         \", \".join(sorted(archive_hashes)),\n      630│                         package,\n      631│                         archive_path.name,\n    → 632│                         \", \".join(sorted(hashes)),\n      633│                     )\n      634│                 )\n      635│\n      636│         return archive\n\n  • Installing python-dateutil (2.8.2)\n  • Installing pytz (2021.3)\n\nFailed to add packages, reverting the pyproject.toml file to its original content.\n\nAttempt to solve\nremove existing poetry installation\ncurl -sSL https://install.python-poetry.org | python3 - --uninstall\n\ninstall specific poetry version\nTrying to following this issue comment I installed with:\n\ncurl -sSL https://install.python-poetry.org | python3 - --version 1.1.8\n\nTry creating another env like before (Still fails)\nI'm still getting failures.\n\npython --version\n    Python 3.8.12\n\npoetry --version\n    Poetry version 1.1.8\n\npoetry new install_check_2\n    Created package install_check_2 in install_check_2\n\ncd install_check_2\n\nThen within the newly created project:\n\npoetry env use python3.8\n    Creating vir","ecosystem":"pypi","package_name":"numpy","package_version":null,"solution":"There are several issue reports about invalid hashes. One common cause is running multiple Poetry instances simultaneously; another is aborted downloads (e.g. ^C). Poetry should be fixed to make corruption less likely to happen in such cases, and perhaps to try downloading corrupted files again automatically.\n\nUntil then, the workaround is to remove the offending file from the cache and let Poetry download a fresh copy.\n\nYou can find the full path to the offending file like this:\n\n$ find ~/.cache/pypoetry -name numpy-1.22.2-cp38-cp38-macosx_10_14_x86_64.whl\n\nOr, for the lazy, just blow away the entire cache:\n\n$ rm -rf ~/.cache/pypoetry","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/71001968/python-poetry-install-failure-invalid-hashes","votes":39,"created_at":"2026-04-19T04:52:24.095599+00:00","updated_at":"2026-04-19T04:52:24.095599+00:00"}