8

I was going to install torch in virtual environment. So I commanded !pip install torch, but there was an ERROR.

Collecting torch
    Using cached torch-1.7.0-cp37-cp37m-win_amd64.whl(184.0 MB)
ERROR: torch ahs an invalid wheel, .dist-info directory not found

In How to fix ".dist-info directory not found" in my package? here, One answer said that deleting Appdata/Local/pip/Cache flder was working.

What should I do?

ssw101
  • 195
  • 2
  • 2
  • 8

4 Answers4

13

time has passed. But just in case someone happens to com on this post because of the same issue, you can try the following commands:

If you do not need a CUDA installation

pip install torch==1.7.0+cpu torchvision==0.8.1+cpu torchaudio===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html

If you fo need a CUDA installation

pip install torch===1.7.0 torchvision===0.8.1 torchaudio===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html

More details about the CUDA version on the official website

Dharman
  • 30,962
  • 25
  • 85
  • 135
Selfcontrol7
  • 155
  • 1
  • 7
  • Thank you so much! It was an error related to the version of CUDA. I have CUDA 10.0, so I should have installed the torch version for it. – ssw101 Dec 11 '20 at 05:09
0

I deleted the Appdata/Local/pip/Cache folder in a hurry and tried it and it was installed. Since the deleted folder is still in the Recycle Bin, I decided there would be no problem.

ssw101
  • 195
  • 2
  • 2
  • 8
  • Holy, after installing, the same error was appeared......... And it doesn't installed.. – ssw101 Dec 08 '20 at 01:49
  • What do you mean by "after installing ... it doesn't installed"? – FlyingTeller Dec 08 '20 at 07:06
  • @FlyingTeller It's like we are living in the same world, I am facing the same issue right now and earlier when I saw this page your comment wasn't there. I deleted that same Cache folder but its not installing for me – Zubair Ahmed Dec 08 '20 at 07:56
0

I have the same problem. Try to install a previous version:

pip install torch===1.6.0 torchvision===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html
Sven Eberth
  • 3,057
  • 12
  • 24
  • 29
jian
  • 21
  • 1
0

I believe I somehow messed up the venv folder (I think it's about pip cache or something), so any try of pip install -r requirements.txt failed. I just deleted venv folder and recreated it with python -m venv venv

Just after that everything worked as expected and pip install -r requirements.txt installed all the packages