错误:火炬的轮子无效,找不到 .dist-info 目录

ssw*_*101 6 pip torch

我打算在虚拟环境中安装火炬。所以我命令 !pip install torch,但有一个错误。

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
Run Code Online (Sandbox Code Playgroud)

如何修复我的包中的“.dist-info 目录未找到”?在这里,一个答案说删除 Appdata/Local/pip/Cache flder 是有效的。

我该怎么办?

小智 10

时间过去了。但万一有人因为同样的问题碰巧在这篇文章上发帖,你可以尝试以下命令:

如果您不需要 CUDA 安装

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
Run Code Online (Sandbox Code Playgroud)

如果您需要 CUDA 安装

pip install torch===1.7.0 torchvision===0.8.1 torchaudio===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html
Run Code Online (Sandbox Code Playgroud)

更多CUDA版本详情请见官