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.

pipenv install fails due to packages not matching hashes from requirements file

See original GitHub issue

Be sure to check the existing issues (both open and closed!), and make sure you are running the latest version of Pipenv.

Check the diagnose documentation for common issues before posting! We may close your issue if it is very similar to one of them. Please be considerate, or be on your way.

Make sure to mention your debugging experience if the documented solution failed.

Issue description

Running pipenv install on a Raspberry Pi results in the following error:

Installing dependencies from Pipfile.lock (330cd4)...
Installing dependencies from Pipfile.lock (330cd4)...
An error occurred while installing certifi==2022.9.24 ; python_version >= '3.6' --hash=sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14 --hash=sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382! Will try again.
An error occurred while installing charset-normalizer==2.1.1 ; python_full_version >= '3.6.0' --hash=sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f --hash=sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845! Will try again.
An error occurred while installing idna==3.4 ; python_version >= '3.5' --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2! Will try again.
An error occurred while installing requests==2.28.1 ; python_version >= '3.7' and python_version < '4' --hash=sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983 --hash=sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349! Will try again.
An error occurred while installing robotframework==6.0.1 --hash=sha256:b2d9a82912dfd27aae7afaad64771c58f5d948ca9d64e3ae72b16721b5e022ea --hash=sha256:5f665413845dfea603de1ed0d0ba8928748ccd2f9a558889822916d778731fbb! Will try again.
An error occurred while installing robotframework-requests==0.9.4 --hash=sha256:fed02b07fd665c96d7473f311552eb7dc7a266c75f8f6166f92dc82371a018f2 --hash=sha256:e00943b8526c38bed5c3c661c813ec9d5a2106961bd91da0068712c2a0d49e82! Will try again.
An error occurred while installing urllib3==1.26.12 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4' --hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e --hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997! Will try again.
Installing initially failed dependencies...
[pipenv.exceptions.InstallError]: Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
[pipenv.exceptions.InstallError]: Collecting certifi==2022.9.24
[pipenv.exceptions.InstallError]:   Using cached https://www.piwheels.org/simple/certifi/certifi-2022.9.24-py3-none-any.whl (161 kB)
[pipenv.exceptions.InstallError]: ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
[pipenv.exceptions.InstallError]:     certifi==2022.9.24 from https://www.piwheels.org/simple/certifi/certifi-2022.9.24-py3-none-any.whl#sha256=70fa284520b2a9be47502025d8a755e6bdb06327baaa9097fe59759c236ade4b (from -r /tmp/pipenv-a304ihl7-requirements/pipenv-g1zcyh5f-hashed-reqs.txt (line 1)):
[pipenv.exceptions.InstallError]:         Expected sha256 0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14
[pipenv.exceptions.InstallError]:         Expected     or 90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382
[pipenv.exceptions.InstallError]:              Got        70fa284520b2a9be47502025d8a755e6bdb06327baaa9097fe59759c236ade4b
ERROR: Couldn't install package: [Requirement(_name='certifi', vcs=None, req=NamedRequirement(name='certifi', version='==2022.9.24', req=Requirement.parse('certifi==2022.9.24; python_version >= "3.6"'), extras=[], editable=False, _parsed_line=<Line (editable=False, name=certifi, path=None, uri=None, extras=(), markers=python_version >= '3.6', vcs=None, specifier===2022.9.24, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=certifi==2022.9.24)>), markers='python_version >= "3.6"', _specifiers='==2022.9.24', index=None, editable=False, hashes=frozenset({'sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14', 'sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382'}), extras=(), abstract_dep=None, _line_instance=<Line (editable=False, name=certifi, path=None, uri=None, extras=(), markers=python_version >= '3.6', vcs=None, specifier===2022.9.24, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=certifi==2022.9.24)>, _ireq=None), Requirement(_name='charset-normalizer', vcs=None, req=NamedRequirement(name='charset-normalizer', version='==2.1.1', req=Requirement.parse('charset-normalizer==2.1.1; python_full_version >= "3.6.0"'), extras=[], editable=False, _parsed_line=<Line (editable=False, name=charset-normalizer, path=None, uri=None, extras=(), markers=python_full_version >= '3.6.0', vcs=None, specifier===2.1.1, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=charset-normalizer==2.1.1)>), markers='python_full_version >= "3.6.0"', _specifiers='==2.1.1', index=None, editable=False, hashes=frozenset({'sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f', 'sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845'}), extras=(), abstract_dep=None, _line_instance=<Line (editable=False, name=charset-normalizer, path=None, uri=None, extras=(), markers=python_full_version >= '3.6.0', vcs=None, specifier===2.1.1, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=charset-normalizer==2.1.1)>, _ireq=None), Requirement(_name='idna', vcs=None, req=NamedRequirement(name='idna', version='==3.4', req=Requirement.parse('idna==3.4; python_version >= "3.5"'), extras=[], editable=False, _parsed_line=<Line (editable=False, name=idna, path=None, uri=None, extras=(), markers=python_version >= '3.5', vcs=None, specifier===3.4, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=idna==3.4)>), markers='python_version >= "3.5"', _specifiers='==3.4', index=None, editable=False, hashes=frozenset({'sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4', 'sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2'}), extras=(), abstract_dep=None, _line_instance=<Line (editable=False, name=idna, path=None, uri=None, extras=(), markers=python_version >= '3.5', vcs=None, specifier===3.4, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=idna==3.4)>, _ireq=None), Requirement(_name='requests', vcs=None, req=NamedRequirement(name='requests', version='==2.28.1', req=Requirement.parse('requests==2.28.1; python_version >= "3.7" and python_version < "4"'), extras=[], editable=False, _parsed_line=<Line (editable=False, name=requests, path=None, uri=None, extras=(), markers=python_version >= '3.7' and python_version < '4', vcs=None, specifier===2.28.1, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=requests==2.28.1)>), markers='python_version >= "3.7" and python_version < "4"', _specifiers='==2.28.1', index=None, editable=False, hashes=frozenset({'sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983', 'sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349'}), extras=(), abstract_dep=None, _line_instance=<Line (editable=False, name=requests, path=None, uri=None, extras=(), markers=python_version >= '3.7' and python_version < '4', vcs=None, specifier===2.28.1, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=requests==2.28.1)>, _ireq=None), Requirement(_name='robotframework', vcs=None, req=NamedRequirement(name='robotframework', version='==6.0.1', req=Requirement.parse('robotframework==6.0.1'), extras=[], editable=False, _parsed_line=<Line (editable=False, name=robotframework, path=None, uri=None, extras=(), markers=None, vcs=None, specifier===6.0.1, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=robotframework==6.0.1)>), markers=None, _specifiers='==6.0.1', index='pypi', editable=False, hashes=frozenset({'sha256:b2d9a82912dfd27aae7afaad64771c58f5d948ca9d64e3ae72b16721b5e022ea', 'sha256:5f665413845dfea603de1ed0d0ba8928748ccd2f9a558889822916d778731fbb'}), extras=(), abstract_dep=None, _line_instance=<Line (editable=False, name=robotframework, path=None, uri=None, extras=(), markers=None, vcs=None, specifier===6.0.1, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=robotframework==6.0.1)>, _ireq=None), Requirement(_name='robotframework-requests', vcs=None, req=NamedRequirement(name='robotframework-requests', version='==0.9.4', req=Requirement.parse('robotframework-requests==0.9.4'), extras=[], editable=False, _parsed_line=<Line (editable=False, name=robotframework-requests, path=None, uri=None, extras=(), markers=None, vcs=None, specifier===0.9.4, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=robotframework-requests==0.9.4)>), markers=None, _specifiers='==0.9.4', index='pypi', editable=False, hashes=frozenset({'sha256:fed02b07fd665c96d7473f311552eb7dc7a266c75f8f6166f92dc82371a018f2', 'sha256:e00943b8526c38bed5c3c661c813ec9d5a2106961bd91da0068712c2a0d49e82'}), extras=(), abstract_dep=None, _line_instance=<Line (editable=False, name=robotframework-requests, path=None, uri=None, extras=(), markers=None, vcs=None, specifier===0.9.4, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=robotframework-requests==0.9.4)>, _ireq=None), Requirement(_name='urllib3', vcs=None, req=NamedRequirement(name='urllib3', version='==1.26.12', req=Requirement.parse('urllib3==1.26.12; python_version >= "2.7" and python_version not in "3.0, 3.1, 3.2, 3.3, 3.4, 3.5" and python_version < "4"'), extras=[], editable=False, _parsed_line=<Line (editable=False, name=urllib3, path=None, uri=None, extras=(), markers=python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4', vcs=None, specifier===1.26.12, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=urllib3==1.26.12)>), markers='python_version >= "2.7" and python_version not in "3.0, 3.1, 3.2, 3.3, 3.4, 3.5" and python_version < "4"', _specifiers='==1.26.12', index=None, editable=False, hashes=frozenset({'sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e', 'sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997'}), extras=(), abstract_dep=None, _line_instance=<Line (editable=False, name=urllib3, path=None, uri=None, extras=(), markers=python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4', vcs=None, specifier===1.26.12, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=urllib3==1.26.12)>, _ireq=None)]
 Package installation failed...

Expected result

I should be able to install packages using pipenv.

Actual result

Installing dependencies from Pipfile.lock (330cd4)...
Installing dependencies from Pipfile.lock (330cd4)...
Writing supplied requirement line to temporary file: "certifi==2022.9.24 ; python_version >= '3.6' --hash=sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382 --hash=sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14"
Writing supplied requirement line to temporary file: "charset-normalizer==2.1.1 ; python_full_version >= '3.6.0' --hash=sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845 --hash=sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f"
Writing supplied requirement line to temporary file: "idna==3.4 ; python_version >= '3.5' --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"
Writing supplied requirement line to temporary file: "requests==2.28.1 ; python_version >= '3.7' and python_version < '4' --hash=sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349 --hash=sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983"
Writing supplied requirement line to temporary file: 'robotframework==6.0.1 --hash=sha256:b2d9a82912dfd27aae7afaad64771c58f5d948ca9d64e3ae72b16721b5e022ea --hash=sha256:5f665413845dfea603de1ed0d0ba8928748ccd2f9a558889822916d778731fbb'
Writing supplied requirement line to temporary file: 'robotframework-requests==0.9.4 --hash=sha256:fed02b07fd665c96d7473f311552eb7dc7a266c75f8f6166f92dc82371a018f2 --hash=sha256:e00943b8526c38bed5c3c661c813ec9d5a2106961bd91da0068712c2a0d49e82'
Writing supplied requirement line to temporary file: "urllib3==1.26.12 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4' --hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997 --hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e"
Install Phase: Standard Requirements
Preparing Installation of 'certifi'
Preparing Installation of 'charset-normalizer'
Preparing Installation of 'idna'
Preparing Installation of 'requests'
Preparing Installation of 'robotframework'
Preparing Installation of 'robotframework-requests'
Preparing Installation of 'urllib3'
$ /home/pi/.local/share/virtualenvs/test-pipenv-VvuyqbGz/bin/python /home/pi/.local/pipx/venvs/pipenv/lib/python3.10/site-packages/pipenv/patched/pip/__pip-runner__.py install -i https://pypi.org/simple --no-input --upgrade --no-deps --exists-action=i -r /tmp/pipenv-kxnjxwsm-requirements/pipenv-azacbxhq-hashed-reqs.txt
Using source directory: '/home/pi/.local/share/virtualenvs/test-pipenv-VvuyqbGz/src'
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple

Collecting certifi==2022.9.24

  Using cached https://www.piwheels.org/simple/certifi/certifi-2022.9.24-py3-none-any.whl (161 kB)

ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
    certifi==2022.9.24 from https://www.piwheels.org/simple/certifi/certifi-2022.9.24-py3-none-any.whl#sha256=70fa284520b2a9be47502025d8a755e6bdb06327baaa9097fe59759c236ade4b (from -r /tmp/pipenv-kxnjxwsm-requirements/pipenv-azacbxhq-hashed-reqs.txt (line 1)):
        Expected sha256 0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14
        Expected     or 90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382
             Got        70fa284520b2a9be47502025d8a755e6bdb06327baaa9097fe59759c236ade4b
An error occurred while installing certifi==2022.9.24 ; python_version >= '3.6' --hash=sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382 --hash=sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14! Will try again.
An error occurred while installing charset-normalizer==2.1.1 ; python_full_version >= '3.6.0' --hash=sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845 --hash=sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f! Will try again.
An error occurred while installing idna==3.4 ; python_version >= '3.5' --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2! Will try again.
An error occurred while installing requests==2.28.1 ; python_version >= '3.7' and python_version < '4' --hash=sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349 --hash=sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983! Will try again.
An error occurred while installing robotframework==6.0.1 --hash=sha256:b2d9a82912dfd27aae7afaad64771c58f5d948ca9d64e3ae72b16721b5e022ea --hash=sha256:5f665413845dfea603de1ed0d0ba8928748ccd2f9a558889822916d778731fbb! Will try again.
An error occurred while installing robotframework-requests==0.9.4 --hash=sha256:fed02b07fd665c96d7473f311552eb7dc7a266c75f8f6166f92dc82371a018f2 --hash=sha256:e00943b8526c38bed5c3c661c813ec9d5a2106961bd91da0068712c2a0d49e82! Will try again.
An error occurred while installing urllib3==1.26.12 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4' --hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997 --hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e! Will try again.
Installing initially failed dependencies...
Writing supplied requirement line to temporary file: "certifi==2022.9.24 ; python_version >= '3.6' --hash=sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382 --hash=sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14"
Writing supplied requirement line to temporary file: "charset-normalizer==2.1.1 ; python_full_version >= '3.6.0' --hash=sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845 --hash=sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f"
Writing supplied requirement line to temporary file: "idna==3.4 ; python_version >= '3.5' --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"
Writing supplied requirement line to temporary file: "requests==2.28.1 ; python_version >= '3.7' and python_version < '4' --hash=sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349 --hash=sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983"
Writing supplied requirement line to temporary file: 'robotframework==6.0.1 --hash=sha256:b2d9a82912dfd27aae7afaad64771c58f5d948ca9d64e3ae72b16721b5e022ea --hash=sha256:5f665413845dfea603de1ed0d0ba8928748ccd2f9a558889822916d778731fbb'
Writing supplied requirement line to temporary file: 'robotframework-requests==0.9.4 --hash=sha256:fed02b07fd665c96d7473f311552eb7dc7a266c75f8f6166f92dc82371a018f2 --hash=sha256:e00943b8526c38bed5c3c661c813ec9d5a2106961bd91da0068712c2a0d49e82'
Writing supplied requirement line to temporary file: "urllib3==1.26.12 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4' --hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997 --hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e"
Install Phase: Standard Requirements
Preparing Installation of 'certifi'
Preparing Installation of 'charset-normalizer'
Preparing Installation of 'idna'
Preparing Installation of 'requests'
Preparing Installation of 'robotframework'
Preparing Installation of 'robotframework-requests'
Preparing Installation of 'urllib3'
$ /home/pi/.local/share/virtualenvs/test-pipenv-VvuyqbGz/bin/python /home/pi/.local/pipx/venvs/pipenv/lib/python3.10/site-packages/pipenv/patched/pip/__pip-runner__.py install -i https://pypi.org/simple --no-input --upgrade --no-use-pep517 --no-deps --exists-action=i -r /tmp/pipenv-kxnjxwsm-requirements/pipenv-y_ydzh2m-hashed-reqs.txt
Using source directory: '/home/pi/.local/share/virtualenvs/test-pipenv-VvuyqbGz/src'
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple

Collecting certifi==2022.9.24

  Using cached https://www.piwheels.org/simple/certifi/certifi-2022.9.24-py3-none-any.whl (161 kB)

ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
    certifi==2022.9.24 from https://www.piwheels.org/simple/certifi/certifi-2022.9.24-py3-none-any.whl#sha256=70fa284520b2a9be47502025d8a755e6bdb06327baaa9097fe59759c236ade4b (from -r /tmp/pipenv-kxnjxwsm-requirements/pipenv-y_ydzh2m-hashed-reqs.txt (line 1)):
        Expected sha256 0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14
        Expected     or 90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382
             Got        70fa284520b2a9be47502025d8a755e6bdb06327baaa9097fe59759c236ade4b
[pipenv.exceptions.InstallError]: ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
[pipenv.exceptions.InstallError]:     certifi==2022.9.24 from https://www.piwheels.org/simple/certifi/certifi-2022.9.24-py3-none-any.whl#sha256=70fa284520b2a9be47502025d8a755e6bdb06327baaa9097fe59759c236ade4b (from -r /tmp/pipenv-kxnjxwsm-requirements/pipenv-y_ydzh2m-hashed-reqs.txt (line 1)):
[pipenv.exceptions.InstallError]:         Expected sha256 0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14
[pipenv.exceptions.InstallError]:         Expected     or 90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382
[pipenv.exceptions.InstallError]:              Got        70fa284520b2a9be47502025d8a755e6bdb06327baaa9097fe59759c236ade4b
ERROR: Couldn't install package: [Requirement(_name='certifi', vcs=None, req=NamedRequirement(name='certifi', version='==2022.9.24', req=Requirement.parse('certifi==2022.9.24; python_version >= "3.6"'), extras=[], editable=False, _parsed_line=<Line (editable=False, name=certifi, path=None, uri=None, extras=(), markers=python_version >= '3.6', vcs=None, specifier===2022.9.24, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=certifi==2022.9.24)>), markers='python_version >= "3.6"', _specifiers='==2022.9.24', index=None, editable=False, hashes=frozenset({'sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382', 'sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14'}), extras=(), abstract_dep=None, _line_instance=<Line (editable=False, name=certifi, path=None, uri=None, extras=(), markers=python_version >= '3.6', vcs=None, specifier===2022.9.24, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=certifi==2022.9.24)>, _ireq=None), Requirement(_name='charset-normalizer', vcs=None, req=NamedRequirement(name='charset-normalizer', version='==2.1.1', req=Requirement.parse('charset-normalizer==2.1.1; python_full_version >= "3.6.0"'), extras=[], editable=False, _parsed_line=<Line (editable=False, name=charset-normalizer, path=None, uri=None, extras=(), markers=python_full_version >= '3.6.0', vcs=None, specifier===2.1.1, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=charset-normalizer==2.1.1)>), markers='python_full_version >= "3.6.0"', _specifiers='==2.1.1', index=None, editable=False, hashes=frozenset({'sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845', 'sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f'}), extras=(), abstract_dep=None, _line_instance=<Line (editable=False, name=charset-normalizer, path=None, uri=None, extras=(), markers=python_full_version >= '3.6.0', vcs=None, specifier===2.1.1, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=charset-normalizer==2.1.1)>, _ireq=None), Requirement(_name='idna', vcs=None, req=NamedRequirement(name='idna', version='==3.4', req=Requirement.parse('idna==3.4; python_version >= "3.5"'), extras=[], editable=False, _parsed_line=<Line (editable=False, name=idna, path=None, uri=None, extras=(), markers=python_version >= '3.5', vcs=None, specifier===3.4, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=idna==3.4)>), markers='python_version >= "3.5"', _specifiers='==3.4', index=None, editable=False, hashes=frozenset({'sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4', 'sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2'}), extras=(), abstract_dep=None, _line_instance=<Line (editable=False, name=idna, path=None, uri=None, extras=(), markers=python_version >= '3.5', vcs=None, specifier===3.4, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=idna==3.4)>, _ireq=None), Requirement(_name='requests', vcs=None, req=NamedRequirement(name='requests', version='==2.28.1', req=Requirement.parse('requests==2.28.1; python_version >= "3.7" and python_version < "4"'), extras=[], editable=False, _parsed_line=<Line (editable=False, name=requests, path=None, uri=None, extras=(), markers=python_version >= '3.7' and python_version < '4', vcs=None, specifier===2.28.1, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=requests==2.28.1)>), markers='python_version >= "3.7" and python_version < "4"', _specifiers='==2.28.1', index=None, editable=False, hashes=frozenset({'sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349', 'sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983'}), extras=(), abstract_dep=None, _line_instance=<Line (editable=False, name=requests, path=None, uri=None, extras=(), markers=python_version >= '3.7' and python_version < '4', vcs=None, specifier===2.28.1, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=requests==2.28.1)>, _ireq=None), Requirement(_name='robotframework', vcs=None, req=NamedRequirement(name='robotframework', version='==6.0.1', req=Requirement.parse('robotframework==6.0.1'), extras=[], editable=False, _parsed_line=<Line (editable=False, name=robotframework, path=None, uri=None, extras=(), markers=None, vcs=None, specifier===6.0.1, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=robotframework==6.0.1)>), markers=None, _specifiers='==6.0.1', index='pypi', editable=False, hashes=frozenset({'sha256:b2d9a82912dfd27aae7afaad64771c58f5d948ca9d64e3ae72b16721b5e022ea', 'sha256:5f665413845dfea603de1ed0d0ba8928748ccd2f9a558889822916d778731fbb'}), extras=(), abstract_dep=None, _line_instance=<Line (editable=False, name=robotframework, path=None, uri=None, extras=(), markers=None, vcs=None, specifier===6.0.1, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=robotframework==6.0.1)>, _ireq=None), Requirement(_name='robotframework-requests', vcs=None, req=NamedRequirement(name='robotframework-requests', version='==0.9.4', req=Requirement.parse('robotframework-requests==0.9.4'), extras=[], editable=False, _parsed_line=<Line (editable=False, name=robotframework-requests, path=None, uri=None, extras=(), markers=None, vcs=None, specifier===0.9.4, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=robotframework-requests==0.9.4)>), markers=None, _specifiers='==0.9.4', index='pypi', editable=False, hashes=frozenset({'sha256:fed02b07fd665c96d7473f311552eb7dc7a266c75f8f6166f92dc82371a018f2', 'sha256:e00943b8526c38bed5c3c661c813ec9d5a2106961bd91da0068712c2a0d49e82'}), extras=(), abstract_dep=None, _line_instance=<Line (editable=False, name=robotframework-requests, path=None, uri=None, extras=(), markers=None, vcs=None, specifier===0.9.4, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=robotframework-requests==0.9.4)>, _ireq=None), Requirement(_name='urllib3', vcs=None, req=NamedRequirement(name='urllib3', version='==1.26.12', req=Requirement.parse('urllib3==1.26.12; python_version >= "2.7" and python_version not in "3.0, 3.1, 3.2, 3.3, 3.4, 3.5" and python_version < "4"'), extras=[], editable=False, _parsed_line=<Line (editable=False, name=urllib3, path=None, uri=None, extras=(), markers=python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4', vcs=None, specifier===1.26.12, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=urllib3==1.26.12)>), markers='python_version >= "2.7" and python_version not in "3.0, 3.1, 3.2, 3.3, 3.4, 3.5" and python_version < "4"', _specifiers='==1.26.12', index=None, editable=False, hashes=frozenset({'sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997', 'sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e'}), extras=(), abstract_dep=None, _line_instance=<Line (editable=False, name=urllib3, path=None, uri=None, extras=(), markers=python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4', vcs=None, specifier===1.26.12, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=urllib3==1.26.12)>, _ireq=None)]
 Package installation failed...

Steps to replicate

I’ve installed pipenv using the following steps:

  1. Install pyenv manually (running the steps from https://github.com/pyenv/pyenv-installer)
  2. Installed pipenv via pipx
  3. Created a simple Pipefile
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
robotframework = "5.0.x"
robotframework-requests = "0.9.x"

[requires]
python_version = "3.10"
  1. Ran pipenv shell
Creating a virtualenv for this project...
Pipfile: /home/pi/test-pipenv/Pipfile
Using /home/pi/.pyenv/versions/3.10.8/bin/python3 (3.10.8) to create virtualenv...
⠸ Creating virtual environment...created virtual environment CPython3.10.8.final.0-32 in 664ms
  creator Venv(dest=/home/pi/.local/share/virtualenvs/test-pipenv-VvuyqbGz, clear=False, no_vcs_ignore=False, global=False, describe=CPython3Posix)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/pi/.local/share/virtualenv)
    added seed packages: pip==22.3, setuptools==65.5.0, wheel==0.37.1
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

✔ Successfully created virtual environment! 
Virtualenv location: /home/pi/.local/share/virtualenvs/test-pipenv-VvuyqbGz
Launching subshell in virtual environment...
 . /home/pi/.local/share/virtualenvs/test-pipenv-VvuyqbGz/bin/activate
  1. Ran pipenv install --dev

$ pipenv --support

Pipenv version: '2022.11.5'

Pipenv location: '/home/pi/.local/pipx/venvs/pipenv/lib/python3.10/site-packages/pipenv'

Python location: '/home/pi/.local/pipx/venvs/pipenv/bin/python'

OS Name: 'posix'

User pip version: '22.3'

user Python installations found:

  • 3.10.8: /home/pi/.local/share/virtualenvs/test-pipenv-VvuyqbGz/bin/python
  • 3.10.8: /home/pi/.local/share/virtualenvs/test-pipenv-VvuyqbGz/bin/python3
  • 3.10.8: /home/pi/.local/share/virtualenvs/test-pipenv-VvuyqbGz/bin/python
  • 3.10.8: /home/pi/.local/share/virtualenvs/test-pipenv-VvuyqbGz/bin/python3
  • 3.10.8: /home/pi/.pyenv/versions/3.10.8/bin/python
  • 3.7.3: /usr/bin/python3.7m
  • 3.7.3: /usr/bin/python3
  • 3.7.3: /usr/bin/python3.7
  • 3.7.3: /bin/python3.7m
  • 3.7.3: /bin/python3
  • 3.7.3: /bin/python3.7
  • 2.7.16: /usr/bin/python2.7
  • 2.7.16: /usr/bin/python2
  • 2.7.16: /usr/bin/python
  • 2.7.16: /bin/python2.7
  • 2.7.16: /bin/python2
  • 2.7.16: /bin/python
  • 2.7.13: /usr/bin/pypy
  • 2.7.13: /bin/pypy

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.10.8',
 'os_name': 'posix',
 'platform_machine': 'armv7l',
 'platform_python_implementation': 'CPython',
 'platform_release': '5.10.17-v7l+',
 'platform_system': 'Linux',
 'platform_version': '#1414 SMP Fri Apr 30 13:20:47 BST 2021',
 'python_full_version': '3.10.8',
 'python_version': '3.10',
 'sys_platform': 'linux'}

System environment variables:

  • SHELL
  • PYENV_SHELL
  • PIPENV_ACTIVE
  • NO_AT_BRIDGE
  • GOBIN
  • PWD
  • LOGNAME
  • XDG_SESSION_TYPE
  • PIP_PYTHON_PATH
  • HOME
  • LANG
  • LS_COLORS
  • VIRTUAL_ENV
  • GOROOT
  • PYTHONFINDER_IGNORE_UNSUPPORTED
  • XDG_SESSION_CLASS
  • TERM
  • USER
  • PIP_DISABLE_PIP_VERSION_CHECK
  • SHLVL
  • XDG_SESSION_ID
  • PYTHONDONTWRITEBYTECODE
  • LC_CTYPE
  • XDG_RUNTIME_DIR
  • PS1
  • LC_ALL
  • PATH
  • DBUS_SESSION_BUS_ADDRESS
  • MAIL
  • SSH_TTY
  • OLDPWD
  • GOPATH
  • TEXTDOMAIN
  • _

Pipenv–specific environment variables:

  • PIPENV_ACTIVE: 1

Debug–specific environment variables:

  • PATH: /home/pi/.local/share/virtualenvs/test-pipenv-VvuyqbGz/bin:/home/pi/.local/bin:/home/pi/bin:/home/pi/.pyenv/shims:/home/pi/.pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/usr/local/go/bin:/home/pi/go/bin
  • SHELL: /bin/bash
  • LANG: en_GB.UTF-8
  • PWD: /home/pi/test-pipenv
  • VIRTUAL_ENV: /home/pi/.local/share/virtualenvs/test-pipenv-VvuyqbGz

Contents of Pipfile (‘/home/pi/test-pipenv/Pipfile’):

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
robotframework = "5.0.x"
robotframework-requests = "0.9.x"

[requires]
python_version = "3.10"

Contents of Pipfile.lock (‘/home/pi/test-pipenv/Pipfile.lock’):

{
    "_meta": {
        "hash": {
            "sha256": "42fb511e92c0ac3fc0701ad0c1f95ae3faa7264db1b81b111faea4517e330cd4"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.10"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {},
    "develop": {
        "certifi": {
            "hashes": [
                "sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14",
                "sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382"
            ],
            "markers": "python_version >= '3.6'",
            "version": "==2022.9.24"
        },
        "charset-normalizer": {
            "hashes": [
                "sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845",
                "sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f"
            ],
            "markers": "python_full_version >= '3.6.0'",
            "version": "==2.1.1"
        },
        "idna": {
            "hashes": [
                "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4",
                "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"
            ],
            "markers": "python_version >= '3.5'",
            "version": "==3.4"
        },
        "requests": {
            "hashes": [
                "sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983",
                "sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349"
            ],
            "markers": "python_version >= '3.7' and python_version < '4'",
            "version": "==2.28.1"
        },
        "robotframework": {
            "hashes": [
                "sha256:5f665413845dfea603de1ed0d0ba8928748ccd2f9a558889822916d778731fbb",
                "sha256:b2d9a82912dfd27aae7afaad64771c58f5d948ca9d64e3ae72b16721b5e022ea"
            ],
            "index": "pypi",
            "version": "==6.0.1"
        },
        "robotframework-requests": {
            "hashes": [
                "sha256:e00943b8526c38bed5c3c661c813ec9d5a2106961bd91da0068712c2a0d49e82",
                "sha256:fed02b07fd665c96d7473f311552eb7dc7a266c75f8f6166f92dc82371a018f2"
            ],
            "index": "pypi",
            "version": "==0.9.4"
        },
        "urllib3": {
            "hashes": [
                "sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e",
                "sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997"
            ],
            "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4'",
            "version": "==1.26.12"
        }
    }
}

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:9

github_iconTop GitHub Comments

2reactions
MefhigosetHcommented, Nov 14, 2022

Dear @rolandjitsu ,

I face the same issue on a Raspberry pi 4B+ v1.4 with Raspberry Pi OS Lite 64-bits (Release date: September 22nd 2022).

My Pipfile project file is:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
pyzk = "*"
pyodbc = "*"
fpdf = "*"
sendgrid = "*"
sentry-sdk = "*"

[dev-packages]

On the piwheels.org homepage state that they use the file /etc/pip.conf. I renamed this file to /etc/_pip.conf and the problem has gone. Now my pipenv install works fine.

The commands:

$ pipenv --rm
$ sudo apt install unixodbc-dev unixodbc
$ sudo apt clean
$ sudo mv /etc/pip.conf /etc/_pip.conf
$ pipenv --clear
$ pipenv install

More info about my system:

$ python --version && pip3 --version && pipenv --version
Python 3.9.2
pip 22.3.1 from /usr/local/lib/python3.9/dist-packages/pip (python 3.9)
pipenv, version 2022.11.5
$ uname -a
Linux cfee-rpi 5.15.76-v8+ #1597 SMP PREEMPT Fri Nov 4 12:16:41 GMT 2022 aarch64 GNU/Linux
$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
$ pinout
,--------------------------------.
| oooooooooooooooooooo J8   +======
| 1ooooooooooooooooooo  PoE |   Net
|  Wi                    1o +======
|  Fi  Pi Model 4B  V1.4 oo      |
|        ,----. +---+         +====
| |D|    |SoC | |RAM|         |USB3
| |S|    |    | |   |         +====
| |I|    `----' +---+            |
|                   |C|       +====
|                   |S|       |USB2
| pwr   |hd|   |hd| |I||A|    +====
`-| |---|m0|---|m1|----|V|-------'

Revision           : c03114
SoC                : BCM2711
RAM                : 4GB
Storage            : MicroSD
USB ports          : 4 (of which 2 USB3)
Ethernet ports     : 1 (1000Mbps max. speed)
Wi-fi              : True
Bluetooth          : True
Camera ports (CSI) : 1
Display ports (DSI): 1
1reaction
matteiuscommented, Nov 11, 2022

@rolandjitsu The StopIteration thing and having to remove the lock file first was a different bug #5456 which I did a fix for two nights ago – it will be in the next release then the lock file would have updated normally.

I wonder why the other source doesn’t work 😕 I use that source on other machines (mainly macOS) without issues.

Must be something on Raspbian telling pip to use piwheeels.org as an extra source? I noticed it was trying to install the binaries from piwheels.org which are wheel files intended for the arm processor of Raspberry Pi.

Do you have a document or something with recommendations on how to install pyenv + pipenv on Linux (debian) while the system python is also installed? E.g, do I use a system pip to install pipenv or should I first activate a pyenv python version and install pipenv there?

I think you would install pipenv with pip install pipenv --user normally with the system python, no virtualenv. I checked on my linux system, I just add the relevant locations that pipenv and pyenv are installed, to the PATH:

export PATH=$PATH:~/.local/bin
export PATH=$PATH:~/.pyenv/bin
Read more comments on GitHub >

github_iconTop Results From Across the Web

Python packages hash not matching whilst installing using pip
Are you using a requirements file? This error suggests that you're using pip's hash checking mode and may be trying to upgrade a...
Read more >
Error: these packages do not match the hashes from the ...
ERROR : THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the...
Read more >
pipenv Documentation - Read the Docs
Generates and checks file hashes for locked dependencies when installing from ... or pipenv install --deploy since it will verify the package hashes...
Read more >
pip install - pip documentation v22.3.1
Require a hash to check each requirement against, for repeatable installs. This option is implied when any package in a requirements file has...
Read more >
Common Pipenv Errors and How to Solve Them: Why Won't it ...
Pipfile won't lock when it tries to install packages that don't exist, i.e., typos. ... Pipenv looks for the package you specify, whether...
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