3

I am currently trying to install many different libraries into my Python environment. I've currently tried using a virtual environment and conda environment still resulting in similar errors.

As I'm doing this on a VM, I have to go through my corporate proxy, hence my pip install command looks a little verbose like the following:

pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org h5py --proxy http://user:password@proxy.internet.mycompany.local:8080

This had been working fine to download many different packages (including ones that are currently failing now), I'm not too sure what has changed, but now the command results in the following error:

Collecting h5py Downloading h5py-3.1.0-cp37-cp37m-win_amd64.whl \ 4.8 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 . h5py from https://files.pythonhosted.org/packages/53/c2/77bd81922264520b492bd7bfd1a51a845bc1187445408a7a83db284fd566/h5py-3.1.0-cp37-cp37m-win_amd64.whl#sha256=02c391fdb980762a1cc03a4bcaecd03dc463994a9a63a02264830114a96e111f : Expected sha256 02c391fdb980762a1cc03a4bcaecd03dc463994a9a63a02264830114a96e111f Got 3fbaf847f810d5f6970abb0c7754abcca7dea17d315036fe5e4b26f427adf3a6

Although this error will still stay largely the same, the "Got" sha256 will change on each attempt, i.e. the following for the last returned line:

        Got        ff8197d74c233317597b89612691bf420806046093628ac02f0a92df3ac8123a
        Got        8be06806b22d49aaa9b94113d8b3e075539303da96386971600c21cb8b9f8460

To rectify this error I've attempted the following:

I've found a few similar issues to this already on Stack Overflow, but I've found nothing that resolves this.

  • 1
    Have you tried manually visiting this link in the browser: `https://files.pythonhosted.org/packages/53/c2/77bd81922264520b492bd7bfd1a51a845bc1187445408a7a83db28 4fd566/h5py-3.1.0-cp37-cp37m-win_amd64.whl#sha256=02c391fdb980762a1cc03a4bcaecd03dc463994a9a63a02264830114a96e111f`? Maybe it resolves to some kind of error page provided by your corporate proxy? – ForceBru Nov 23 '20 at 15:54
  • I've just updated the question to include more information on the error page response: Failed to load resource: the server responded with a status of 404 (Not Found). Not sure why this is the case though, does this work for other users? – Fabian McGibbon Nov 23 '20 at 16:11
  • Works fine for me - downloaded the `.whl` file – ForceBru Nov 23 '20 at 16:13
  • 1
    I get an invalid reponse/404, northeast US, residential Internet. The responding server for me is `[2a04:4e42::319]:443`. – nanofarad Nov 23 '20 at 16:14
  • Interesting that yours worked @ForceBru, how did you go about finding the responding server @nanofarad? I don't seem to get any response when looking at the network section of chrome > developer tools – Fabian McGibbon Nov 23 '20 at 16:23
  • 1
    @FabianMcGibbon with devtools network tab open, I refreshed, clicked the red failed request, and found "Remote address" on the Headers tab. By visiting http://[2a04:4e42::319], I was informed that this is a Fastly CDN, responding server "cache-lga21973-LGA" – nanofarad Nov 23 '20 at 16:24
  • BTW, your error message talks about `https://files.pythonhosted.org/packages/53/c2/77bd81922264520b492bd7bfd1a51a845bc1187445408a7a83db28`, which is only _part of the full URL_. – ForceBru Nov 23 '20 at 16:25
  • @nanofarad My remote address is 10.78.31.5:8080, I get a HTTP403 saying that I don't have access to view this page. Could this be the root cause of the issue? – Fabian McGibbon Nov 23 '20 at 16:45
  • @FabianMcGibbon That's a 10.0.0.0/8 [private network](https://en.wikipedia.org/wiki/Private_network) address; are you behind a proxy or on a corp network? – nanofarad Nov 23 '20 at 16:52
  • 1
    @nanofarad yes I'm behind a proxy, I've beginning to think this is the root cause of the issue. – Fabian McGibbon Nov 24 '20 at 09:06
  • @nanofarad, I've since attempted accessing this page from different devices such as my personal phone and laptop, and they both result in the exact same error. Maybe this isn't to do with the proxy after all? – Fabian McGibbon Nov 24 '20 at 16:54
  • As I mentioned before, I also got the error from my machine. I am honestly not sure of the next step to troubleshoot this, but I suspect this might be a regional issue with a CDN, if @ForceBru was able to download it. – nanofarad Nov 24 '20 at 18:21
  • @nanofarad cheers for your help, I've switched back to attempting to use conda instead and I'm having slightly more luck. See my new post regarding this here: https://stackoverflow.com/questions/64991855/conda-sha256-checksum-mismatch-error-sha256-hash-constantly-changes?noredirect=1#comment114901854_64991855 – Fabian McGibbon Nov 25 '20 at 07:50

0 Answers0