ERROR: No matching distribution found for torch==1.2.0 解决方法

简介: No matching distribution found

一、环境


系统环境:Windows10

Python版本:Python3.6.0

IDE:Pycharm、Spyder


二、问题


今天用 pip 安装torch,安装方式如下:


pipinstalltorch==1.2.0-ihttp://pypi.douban.com/simple--trusted-hostpypi.douban.com


出现了如下错误:


ERROR:Could not find a version that satisfies the requirement torch1.2.0

ERROR:No matching distribution found for torch1.2.0


三、解决方法


关于"Could not find a version that satisfies…"这类问题,网上说的比较多的主要有这么几种方法:


1、更新pip


python -m pip install --upgrade pip


2、用国内的镜像源来加速网络


pip install 包名 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

其中 --trusted-host pypi.douban.com 是为了获得 SSL 证书的认证。


3. 最终解决


以上方法都试了,然而都没有效果…


恰在此时,不经意间看见一篇文章 Windows 上报错:Could not find a version that satisfies the requirement torch==0.4.1


与我所碰到的问题很类似!于是借鉴这位网友的做法,用 pip 命令从 Pytorch 官网下载指定的版本:


https://www.jianshu.com/p/f54a01419330?utm_campaign=haruki


pipinstalltorch==1.2.0-fhttps://download.pytorch.org/whl/torch_stable.html


但一波刚平,一波又起,这时又报了另一个错:Could not install packages due to an EnvironmentError:[WinError 5] Permission denied

这是由于权限不够,于是将指令改为 pip install --user torch==1.3.0 -f https://download.pytorch.org/whl/torch_stable.html 即可。


当然,也可使用镜像源加速下载,相应的命令为:


pipinstall--usertorch==1.3.0-fhttps://download.pytorch.org/whl/torch_stable.html-ihttp://pypi.douban.com/simple/--trusted-hostpypi.douban.com。


最后成功安装~


pipinstall--usertorch==1.2.0-fhttps://download.pytorch.org/whl/torch_stable.html-ihttp://pypi.douban.com/simple/--trusted-hostpypi.douban.com
目录
相关文章
|
并行计算 PyTorch 算法框架/工具
【pytorch】解决pytorch:Torch not compiled with CUDA enabled
【pytorch】解决pytorch:Torch not compiled with CUDA enabled
8812 0
Ninja is required to load C++ extensions | 问题解决
Ninja is required to load C++ extensions | 问题解决
|
PyTorch Linux 算法框架/工具
pytorch学习一:Anaconda下载、安装、配置环境变量。anaconda创建多版本python环境。安装 pytorch。
这篇文章是关于如何使用Anaconda进行Python环境管理,包括下载、安装、配置环境变量、创建多版本Python环境、安装PyTorch以及使用Jupyter Notebook的详细指南。
1476 1
pytorch学习一:Anaconda下载、安装、配置环境变量。anaconda创建多版本python环境。安装 pytorch。
|
并行计算 计算机视觉
yolov5的detect.py的详细讲解
这篇文章详细讲解了YOLOv5的`detect.py`脚本中的参数,包括模型权重、输入源、图像尺寸、置信度阈值、IOU阈值、设备选择、结果显示、结果保存等,以及如何使用这些参数进行目标检测。
648 1
ERROR: No matching distribution found for gradio>=3.23
该博客文章提供了解决使用pip安装gradio版本3.23时出现的"No matching distribution found"错误的步骤,包括从官网下载相应的whl文件并手动安装。
ERROR: No matching distribution found for gradio>=3.23
|
安全 网络协议 网络安全
【网络连接】ping不通的常见原因+解决方案,如何在只能访问网关时诊断,并修复IP不通的问题
【网络连接】ping不通的常见原因+解决方案,如何在只能访问网关时诊断,并修复IP不通的问题
22801 0
|
JavaScript 前端开发 API
vue3 v-md-editor markdown编辑器(VMdEditor)和预览组件(VMdPreview )的使用
本文介绍了如何在Vue 3项目中使用v-md-editor组件库来创建markdown编辑器和预览组件。文章提供了安装步骤、如何在main.js中进行全局配置、以及如何在页面中使用VMdEditor和VMdPreview组件的示例代码。此外,还提供了一个完整示例的链接,包括编辑器和预览组件的使用效果和代码。
vue3 v-md-editor markdown编辑器(VMdEditor)和预览组件(VMdPreview )的使用
|
机器学习/深度学习 自然语言处理 数据可视化
LlamaFactory可视化微调大模型 - 参数详解
LlamaFactory可视化微调大模型 - 参数详解
2970 4
|
并行计算 PyTorch 算法框架/工具
【已解决】RuntimeError: CuDA error: no kernel image is available for execution on the device
【已解决】RuntimeError: CuDA error: no kernel image is available for execution on the device
|
Python
【Python】已解决ModuleNotFoundError: No module named ‘requests’
【Python】已解决ModuleNotFoundError: No module named ‘requests’
6971 2