ERROR: torch has an invalid wheel, .dist-info directory not found

Viewed 13231

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?

4 Answers

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

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.

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

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

Related