【问题标题】:ERROR: No matching distribution found for torch==1.2.0错误:找不到匹配的分布为 torch==1.2.0
【发布时间】:2022-11-06 01:15:56
【问题描述】:

我正在检查this repo,它说它在requirements.txt 中需要torch==1.2.0。所以尝试安装它们,但我得到了错误。完整的错误:

> pip install torch==1.2.0
ERROR: Could not find a version that satisfies the requirement torch==1.2.0 (from versions: 1.7.0, 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.9.1, 1.10.0, 1.10.1, 1.10.2)
ERROR: No matching distribution found for torch==1.2.0

我检查了this torch page on the PyPI website,它说如果python版本高于3.8,它就可以工作,对吗?我在 python 3.7.9 上并且能够在另一个项目上使用 torch>=1.8.0 运行,所以用 python 3.10.0 更改了 virtualenv。正在重新安装,但我仍然有错误,嗯?

这个设置有什么问题?谢谢。

【问题讨论】:

  • edit您的问题并显示错误消息的更多上下文。
  • 实际上,这就是我得到的所有信息。 > pip install torch==1.2.0 ERROR: Could not find a version that satisfies the requirement torch==1.2.0 (from versions: none) ERROR: No matching distribution found for torch==1.2.0
  • 这只是一个澄清。 pip install -r .\requirements.txt 具有相同的输出。 > pip install -r .\requirements.txt ERROR: Could not find a version that satisfies the requirement torch==1.2.0 (from versions: none) ERROR: No matching distribution found for torch==1.2.0
  • 你的 CUDA 版本是多少?
  • nvidia-smi 说 CUDA 版本:11.5。 > nvidia-smi Sun Jan 30 15:57:39 2022 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 497.29 Driver Version: 497.29 CUDA Version: 11.5 |

标签: python


【解决方案1】:

我在不同的情况下遇到了同样的问题,在我的情况下,我只是将 python 版本降级到 3.7.13 并且火炬安装成功。
您可以尝试使用该版本创建一个新的 conda 环境。
火炬安装命令是conda install pytorch==1.2.0 torchvision==0.4.0 cudatoolkit=10.0 -c pytorch(来自PyTorch site

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-09-02
    • 2020-09-19
    • 2021-10-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-13
    相关资源
    最近更新 更多