ERROR: Could not find a version that satisfies the requirement torch (from versions: none) 解决办法

ERROR: Could not find a version that satisfies the requirement torch (from versions: none) ERROR: No matching distribution found for torch错误解决办法

相关官网:
pytorch官网https://pytorch.org/
清华大学开源软件镜像站https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

1 问题

如果通过conda安装pytorch出现上述错误,如果你是出现了题目上面的错误,但是没有找到原因,可能是本文中遇到的Python版本的问题。
我是用conda默认安装python版本,默认给我安装的是最新版3.13,但是在清华大学镜像站中并没有python3.13的版本对应的pytorch,因此需要安装python3.12或者更低版本。
如果python版本太新就不会有相应的pytorch版本在镜像中,就会出现题目的错误提示

 ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
 ERROR: No matching distribution found for torch错误解决办法

2 解决方法

  1. 查找是否存在版本对应的pytorch
    清华大学开源软件镜像站https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
    在这里插入图片描述
    进入win-64/后搜索cuda12.4版本
    在这里插入图片描述
  2. 删除环境
conda remove -n 环境名 --all
  1. 创建环境
conda create -n 环境名 python=版本号

注意:python版本号得是有对应的pytorch,否则出现错误

  1. 去pytorch官网找安装方法,根据自己的电脑环境安装
    pytorch官网https://pytorch.org/

例如代码如下:

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ywwsnowboy

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值