【问题标题】:ERROR: torch has an invalid wheel, .dist-info directory not found错误:torch 的轮子无效,.dist-info 目录未找到
【发布时间】:2021-03-19 08:25:38
【问题描述】:

我打算在虚拟环境中安装 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

How to fix ".dist-info directory not found" in my package? 这里,一个答案说删除 Appdata/Local/pip/Cache 文件夹是有效的。

我该怎么办?

【问题讨论】:

    标签: pip torch


    【解决方案1】:

    时间已经过去了。但是以防万一有人因为同样的问题而在这篇文章上发表评论,您可以尝试以下命令:

    如果您不需要安装 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
    

    如果您需要 CUDA 安装

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

    更多CUDA版本详情见官方website

    【讨论】:

    • 非常感谢!这是与 CUDA 版本有关的错误。我有 CUDA 10.0,所以我应该为它安装了 torch 版本。
    【解决方案2】:

    我匆忙删除了Appdata/Local/pip/Cache文件夹,试了一下,安装成功了。 由于删除的文件夹还在回收站中,所以我认为没有问题。

    【讨论】:

    • 天哪,安装后出现同样的错误............而且它没有安装......
    • “安装后......它没有安装”是什么意思?
    • @FlyingTeller 就像我们生活在同一个世界一样,当我看到这个页面时,我现在和早些时候都面临同样的问题,你的评论不在那里。我删除了同一个缓存文件夹,但它没有为我安装
    【解决方案3】:

    我也有同样的问题。尝试安装以前的版本:

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

    【讨论】:

      【解决方案4】:

      我相信我以某种方式弄乱了 venv 文件夹(我认为它与 pip 缓存或其他东西有关),所以任何pip install -r requirements.txt 的尝试都失败了。我刚刚删除了 venv 文件夹并用python -m venv venv重新创建了它

      之后一切都按预期工作,pip install -r requirements.txt 安装了所有软件包

      【讨论】:

        猜你喜欢
        • 2021-12-20
        • 1970-01-01
        • 2016-02-03
        • 2020-11-02
        • 2019-11-22
        • 2021-07-15
        • 1970-01-01
        • 2021-09-16
        • 2018-04-21
        相关资源
        最近更新 更多