No matching distribution found for torch==1.2.0 的解决方法 //cuda10.0 pip安装torch报错解决办法// cuda与torch版本不匹配

本机环境:

Python3.7
cuda10.0

问题

用 pip 安装torch,安装方式如下:
pip install torch==1.2.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
在这里插入图片描述

解决办法

在此之前,我试了更新pip,镜像加速等等,都不行,然后看到一篇分享顺利解决了,因此记录下来。

pip install --user torch==1.2.0 -f https://download.pytorch.org/whl/torch_stable.html -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

成功!!
在这里插入图片描述
运行torch.cuda.is_available()
返回为True。

猜你喜欢

转载自blog.csdn.net/qq_45281807/article/details/121123353