一、环境

系统环境:Windows10
Python版本:Python3.6.0
IDE:Pycharm、Spyder

二、问题

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

pip install torch==1.2.0  -i http://pypi.douban.com/simple --trusted-host pypi.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

pip install torch==1.2.0 -f https://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 即可。

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

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

最后成功安装~

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

ERROR: No matching distribution found for torch==1.2.0 解决方法相关推荐

  1. No matching distribution found for torch==1.10.1+cu111

    目录 注意问题 PyTorch 安装 gpu版本的问题 我的电脑配置 不想看我的经历可以直接使用下方命令 对应1.10版本的torch 对应1.9.1版本的torch 对应1.6.0版本的torch ...

  2. Mac下安装virtualenvwrapper提示ERROR: No matching distribution found for pbr

    报错代码: WARNING: The directory '/Users/mac/Library/Caches/pip' or its parent directory is not owned or ...

  3. ERROR: No matching distribution found for numpy

    完整报错长这样: C:\Users\pc-01>pip install numpy Looking in indexes: https://pypi.douban.com/simple Coll ...

  4. 安装LabelMe出现ERROR: No matching distribution found for labelme解决方式(关闭网络代理+使用清华源)

    1.安装指令 pip install labelme -i https://pypi.tuna.tsinghua.edu.cn/simple/ 2.安装细节 3.反思 经常使用pip安装包,总出现ER ...

  5. ERROR: No matching distribution found for xxx

    python pip install 报错 ERROR: Could not find a version that satisfies the requirement requests (from ...

  6. Error: No matching distribution found for swig

    环境实在Windows下,安装swig: pip install swig 发现报错: ERROR: Could not find a version that satisfies the requi ...

  7. ERROR: No matching distribution found for pandas

    利用pip下载pandas时报错: ERROR: Could not find a version that satisfies the requirement pandas (from versio ...

  8. c++中调用python脚本提示 error LNK2001: 无法解析的外部符号 __imp_Py_Initialize等错误的解决方法

    c++中调用python脚本提示 error LNK2001: 无法解析的外部符号 __imp_Py_Initialize等错误的解决方法 时间:2017-05-09 12:32:06阅读:234评论 ...

  9. Error generating final archive: Debug Certificate expired on 的错误解决方法

    Android开发中 Error generating final archive: Debug Certificate expired on 的错误解决方法 问题概述: 在导入一个app后提示如下错 ...

最新文章

  1. PicoBlaze 指令存储器配置方式
  2. 转义字符 /r与/n的区别
  3. 【STL源码剖析】总结笔记(1):开篇
  4. 03.09 随手记(Mock数据生成器,Easy Mock基本使用)
  5. EllSeg训练实验记录代码解析技巧tips
  6. SQL Server 2008 R2
  7. mysql pxc 安装_MYSQL PXC 集群安装
  8. word删除空白页的方法和技巧详细介绍,提高工作效率!!!!!!!!!!!!
  9. 网站在线工具查询链接收录与优化文章收录情况
  10. 51小项目——使用proteus搭建简易的光照度计-(1)
  11. 没有学历怎么找运维工作?
  12. 用 python 绘制玫瑰花
  13. 智能秤方案设计——蓝牙体脂秤PCBA方案
  14. 这篇博客介绍 python 的 re 模块的相关函数/方法,及一些相关符号使用
  15. 电力继电器保护装置电磁兼容测试和环境试验
  16. 续.第一次冲刺之后.
  17. 【SemiDrive源码分析】【MailBox核间通信】42 - 基于Mailbox 实现的 mailbox_demo 应用程序(RTOS Android侧通信实现)
  18. vue组件通讯六种方法。
  19. JavaScript中常用事件有哪些?
  20. PowerPoint让你快速成为PS高手——抠图

热门文章

  1. 剪辑视频、去掉爱剪辑前后广告、视频中添加黑幕简要教程
  2. 财务自由现金管理方法
  3. php 点击按钮触发微信分享,微信自定义分享-PHP
  4. 计算机一级cad试题及答案,计算机一级模拟试题及答案
  5. android n 小米功能,小米的android N遇到google套件问题
  6. 博客园添加背景音乐以及播放器 或在左下方固定位置添加音乐播放器 给你的博文锦上添花,增姿添彩
  7. 报表制作开源工具hcharts
  8. docker安装jira
  9. prometheus详解
  10. I3D (inflated 3D)是什么?