Search code examples
pippytorch

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


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?


Solution

  • 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