请知悉:本文最近一次更新为 5个月 前,文中内容可能已经过时。

最近老大有个临时任务,要跑一个Python脚本,安装依赖的时候,遇到了如下提示:

ERROR: Could not find a version that satisfies the requirement torch==2.1.0 (from versions: none)
ERROR: No matching distribution found for torch==2.1.0

老大只角度是Python3的脚本,其他细节没有。很有趣的问题,经过各种搜索尝试,发现我使用是Python最新版本3.12.0,而找到了篇博客,博主说版本过高引起的问题。

遂降Python版本到3.9.6,之后问题解决。

回头翻PyTorch官网,发现一段话:

[Beta] torch.compile + Python 3.11

torch.compile previously only supported Python versions 3.8-3.10. Users can now optimize models with torch.compile in Python 3.11.

印证了版本过高引起问题的结论。至此问题的已解决。


参考资料

(已解决)安装pytorch时ERROR: Could not find a version that satisfies the requirement torch (from versions: none) ERROR: No matching distribution found for torch

PyTorch 2.1: automatic dynamic shape compilation, distributed checkpointing


如您从本文得到了有价值的信息或帮助,请考虑扫描文末二维码捐赠和鼓励。

尊重他人劳动成果。转载请务必附上原文链接,我将感激不尽。


与《Python ERROR: Could not find a version that satisfies the requirement torch==2.1.0 (from versions: none) 解决办法》相关的博文:


留言

avatar
😀
😀😁😂😅😭🤭😋😘🤔😰😱🤪💪👍👎🤝🌹👌