这些软件包与需求文件中的哈希不匹配

时间:2020-07-21 17:21:00

标签: pip

我在安装pip时遇到了一个非常奇怪的问题。它总是报告不匹配的哈希值。这是我尝试的步骤:

使用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

手动下载并检查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

sha256sum结果与预期的校验和匹配。

重试点子

(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

这一次它带有不同的sha256 校验和。每次都有不同的sha256校验和。

我还尝试了将pip重新安装到20.0.2 ,但是id无效。

我的环境是:

(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)

当我尝试安装其他模块时遇到相同的问题:

[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

我已经做了一些研究,但没有解决。

任何有经验的人都可以分享。

更新#1

7/22/20我在新VM上编译了一个带有OpenSSL 1.1.1g的全新Python 3.7.5。遇到同样的问题。

更新#2

7/22/20使用另一台物理计算机上的VM的测试成功。那意味着,也许我的计算机正在影响我的网络通信。

更新#3

7/29/20,该问题已得到解决,但我不知道为什么。 VM重新启动,我也禁用了selinux。不知道是什么解决了。

0 个答案:

没有答案