TransWikia.com

These packages do not match the hashes from the requirements file

Stack Overflow Asked by felixc on November 10, 2021

I’m having a very weird issue with pip installation. It always reports that mismatch hashes. Here are the steps I was trying:

Install with pip

(p3test) [felixc@ruby tmp]$ pip install --no-cache-dir notebook
Collecting notebook
  Downloading notebook-6.0.3-py3-none-any.whl (9.7 MB)
     |████████████████████████████████| 9.7 MB 12.0 MB/s 
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.
    notebook from https://files.pythonhosted.org/packages/b1/f1/0a67f09ef53a342403ffa66646ee39273e0ac79ffa5de5dbe2f3e28b5bdf/notebook-6.0.3-py3-none-any.whl#sha256=3edc616c684214292994a3af05eaea4cc043f6b4247d830f3a2f209fa7639a80:
        Expected sha256 3edc616c684214292994a3af05eaea4cc043f6b4247d830f3a2f209fa7639a80
             Got        349782fcc5bb888da3743cf48706fecc95cedf94c519870b878c5309a9521ac4

Manually download and check sha256sum

(p3test) [felixc@ruby tmp]$ curl -O https://files.pythonhosted.org/packages/b1/f1/0a67f09ef53a342403ffa66646ee39273e0ac79ffa5de5dbe2f3e28b5bdf/notebook-6.0.3-py3-none-any.whl
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 9449k  100 9449k    0     0  1931k      0  0:00:04  0:00:04 --:--:-- 1958k
(p3test) [felixc@ruby tmp]$ sha256sum notebook-6.0.3-py3-none-any.whl 
3edc616c684214292994a3af05eaea4cc043f6b4247d830f3a2f209fa7639a80  notebook-6.0.3-py3-none-any.whl

The sha256sum result matches the expected checksum.

Try pip again

(p3test) [felixc@ruby tmp]$ pip install --no-cache-dir notebook
Collecting notebook
  Downloading notebook-6.0.3-py3-none-any.whl (9.7 MB)
     |████████████████████████████████| 9.7 MB 1.8 MB/s 
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.
    notebook from https://files.pythonhosted.org/packages/b1/f1/0a67f09ef53a342403ffa66646ee39273e0ac79ffa5de5dbe2f3e28b5bdf/notebook-6.0.3-py3-none-any.whl#sha256=3edc616c684214292994a3af05eaea4cc043f6b4247d830f3a2f209fa7639a80:
        Expected sha256 3edc616c684214292994a3af05eaea4cc043f6b4247d830f3a2f209fa7639a80
             Got        6429a47dc7a50f89173d8745407f154881754e1f832cedc7d61961861937fc33

This time it comes with a different sha256 check sum. It comes with different sha256 check sum each time.

I also tried reinstall pip to 20.0.2 but id didn’t work.

My environment is:

(p3test) [felixc@ruby tmp]$ pip --version
pip 20.1.1 from /home/felixc/tmp/p3test/lib/python3.7/site-packages/pip (python 3.7)
(p3test) [felixc@ruby tmp]$ cat /etc/redhat-release 
CentOS Linux release 7.8.2003 (Core)

I got same issue when I tried to install other modules:

[felixc@ruby ~]$ pip install seaborn
Collecting seaborn
  Using cached seaborn-0.10.1-py3-none-any.whl (215 kB)
Requirement already satisfied: pandas>=0.22.0 in /usr/local/rcchome/local/python37/lib/python3.7/site-packages (from seaborn) (1.0.3)
Requirement already satisfied: numpy>=1.13.3 in /usr/local/rcchome/local/python37/lib/python3.7/site-packages (from seaborn) (1.18.3)
Collecting scipy>=1.0.1
  Downloading scipy-1.5.1-cp37-cp37m-manylinux1_x86_64.whl (25.9 MB)
     |████████████████████████████████| 25.9 MB 110 kB/s 
Collecting matplotlib>=2.1.2
  Downloading matplotlib-3.3.0-1-cp37-cp37m-manylinux1_x86_64.whl (11.5 MB)
     |████████████████████████████████| 11.5 MB 2.6 MB/s 
Requirement already satisfied: pytz>=2017.2 in /usr/local/rcchome/local/python37/lib/python3.7/site-packages (from pandas>=0.22.0->seaborn) (2020.1)
Requirement already satisfied: python-dateutil>=2.6.1 in /usr/local/rcchome/local/python37/lib/python3.7/site-packages (from pandas>=0.22.0->seaborn) (2.8.1)
Requirement already satisfied: six>=1.5 in /usr/local/rcchome/local/python37/lib/python3.7/site-packages (from python-dateutil>=2.6.1->pandas>=0.22.0->seaborn) (1.14.0)
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.
    scipy>=1.0.1 from https://files.pythonhosted.org/packages/30/45/ff9df4beceab76f979ee0ea7f5d248596aa5b0c179aa3d30589a3f4549eb/scipy-1.5.1-cp37-cp37m-manylinux1_x86_64.whl#sha256=fff15df01bef1243468be60c55178ed7576270b200aab08a7ffd5b8e0bbc340c (from seaborn):
        Expected sha256 fff15df01bef1243468be60c55178ed7576270b200aab08a7ffd5b8e0bbc340c
             Got        b3e7592adb5221e46576b9d7da56bbf3b328d2e122770ce264d5c2d905d79e5f

    matplotlib>=2.1.2 from https://files.pythonhosted.org/packages/1c/15/3fea1bfb7e5b77b7cca9c6010a9cabc58ea125385345ecb6f5832eb8b49a/matplotlib-3.3.0-1-cp37-cp37m-manylinux1_x86_64.whl#sha256=19cf4db0272da286863a50406f6430101af129f288c421b1a7f33ddfc8d0180f (from seaborn):
        Expected sha256 19cf4db0272da286863a50406f6430101af129f288c421b1a7f33ddfc8d0180f
             Got        7d882dd5c1ab738d36a133f5353677f69e16ee347ac49106b65b07b2aae2d3a4

I already did some researches but nothing fixed.

Anyone has experience can share is highly appreciated.

Update #1

7/22/20 I compiled a brand new Python 3.7.5 with OpenSSL 1.1.1g on a new VM. Got same issue.

Update #2

7/22/20 A test with a VM on another physical computer was successful. That means, maybe, my computer is having something impacting my network communication.

Update #3

7/29/20 This has been fixed but I don’t know why. The VM restarted and I disabled selinux as well. Not sure what fixed it.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP