安装Pytorch的CUDA11.6的bug,torch.cuda.is_available()返回false

文章讲述了在安装PyTorch时遇到的CPU和GPU版本问题,特别是与CUDA版本不兼容的错误。作者发现Python版本过低可能是原因,升级到3.10.10解决了问题。另外,对于依赖冲突,建议升级pip,指定版本安装或使用conda环境来管理依赖。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

》》》

我一开始的python版本是3.9下载失败,cpu的成功了,但是GPU的不行

当时的下载命令:

pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 torchaudio==0.13.1 --extra-index-url  https://download.pytorch.org/whl/cu116

一、一开始报这个bug

ERROR: Could not find a version that satisfies the requirement
pytorch1.13.1 (from versions: none)ERROR: No matching distribution found for pytorch1.13.1
ERROR: Could not find a version that satisfies the requirement
pytorch1.13.1 (from versions: none)ERROR: No matching distribution found for pytorch1.13.1
ERROR: Could not find a version that satisfies the requirement
pytorch1.13.1 (from versions: none)ERROR: No matching distribution found for pytorch1.13.1

网上一大堆各种解决办法,没到点子上

就是Python版本不够,升级python版本就好

conda install python=3.10.10
  • 我试过了 3.10.0 的版本还是下载不了cuda116,最后我直接升级到 3.10.10 就解决了

  • 你自己试试看得升到哪个版本的 python

二、如果还报bug,如果是下面这个,不兼容:

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

》如下解决办法

  • 1.使用pip install --upgrade pip命令升级pip到最新版本,然后重新安装依赖包。
  • 2.尝试安装指定版本的依赖包,例如pip install package_name==version_number。
  • 3.如果以上方法都不能解决问题,可以使用conda来安装依赖包,它可以更好地处理依赖关系。首先安装Anaconda或Miniconda,然后在conda环境中使用conda install package_name命令安装依赖包。

》。》

再贴上一个相对有用的安装文章 https://blog.youkuaiyun.com/qq_46126258/article/details/112708781

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

木18

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

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

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

打赏作者

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

抵扣说明:

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

余额充值