Issue with installing torch, torchvision and torchaudio

Tried:- pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

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.
torch from https://download.pytorch.org/whl/cu118/torch-2.3.1%2Bcu118-cp312-cp312-win_amd64.whl#sha256=f44c7b64d990a6b1a382d1cd63c359806153974e7db8d16f6780645a8a9c9fe0:
Expected sha256 f44c7b64d990a6b1a382d1cd63c359806153974e7db8d16f6780645a8a9c9fe0
Got 407dc9e3ed038c589cfdb6e9005b0768916b4db075f35e94a953eac3b14f6d33

CC @malfet in case you’ve seen these Windows wheel issues before.

Most likely local cache is corrupted, clean it and try downloading again. Correct sha256 for this file is indeed f44c7b64d990a6b1a382d1cd63c359806153974e7db8d16f6780645a8a9c9fe0:

$ curl -OL https://download.pytorch.org/whl/cu118/torch-2.3.1%2Bcu118-cp312-cp312-win_amd64.whl
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2549M  100 2549M    0     0   376M      0  0:00:06  0:00:06 --:--:--  376M
$ sha256sum torch-2.3.1%2Bcu118-cp312-cp312-win_amd64.whl 
f44c7b64d990a6b1a382d1cd63c359806153974e7db8d16f6780645a8a9c9fe0  torch-2.3.1%2Bcu118-cp312-cp312-win_amd64.whl

1 Like

Hey I was able to solve the issue, I reinstalled pip and it worked it for me. Thank you @malfet and @ptrblck.