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

18 篇文章 2 订阅
7 篇文章 0 订阅
 pip install torch -i https://pypi.org/

在这里插入图片描述

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

我们举一反三,出现类似问题,我们第一选择就是切换镜像站,提供如下:

以下是一些常见的中国国内的Python软件包镜像站,你可以使用其中的任何一个来加速pip安装和更新:

  1. 清华大学镜像站:

  2. 阿里云镜像站:

  3. 豆瓣镜像站:

  4. 中国科技大学镜像站:

你可以选择其中一个镜像站并将其设置为pip的源,方式是在pip命令中加入 -i 参数,后面跟着镜像站的地址。例如:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple <package-name>

你还可以使用 pip config 命令将镜像站设置为默认源,这样后续的pip操作都会使用这个镜像站:

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

通过使用国内镜像站,可以加速Python软件包的下载和安装过程。

注意:关闭飞机,不要翻墙,翻墙了就先关闭软件再试试

注意:关闭飞机,不要翻墙,翻墙了就先关闭软件再试试

注意:关闭飞机,不要翻墙,翻墙了就先关闭软件再试试

注意:关闭飞机,不要翻墙,翻墙了就先关闭软件再试试

注意:关闭飞机,不要翻墙,翻墙了就先关闭软件再试试

注意:关闭飞机,不要翻墙,翻墙了就先关闭软件再试试

但是,如果切换一两个还是报错,即使我们取消了指定版本,那就不用再废力了

PS D:\项目源码\临时部署\operational_platform> pip install torch==1.3.1 -f https://download.pytorch.org/whl/torch_stable.html
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Looking in links: https://download.pytorch.org/whl/torch_stable.html
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /w
hl/torch_stable.html
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /w
hl/torch_stable.html
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /w
hl/torch_stable.html
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /w
hl/torch_stable.html
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /w
hl/torch_stable.html
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /p
ypi/simple/torch/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /p
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /p
ypi/simple/torch/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /p
ypi/simple/torch/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /p
ypi/simple/torch/
ERROR: Could not find a version that satisfies the requirement torch==1.3.1 (from versions: none)
ERROR: No matching distribution found for torch==1.3.1
PS D:\项目源码\临时部署\operational_platform> pip install torch -f https://download.pytorch.org/whl/torch_stable.html       
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Looking in links: https://download.pytorch.org/whl/torch_stable.html
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /w
hl/torch_stable.html
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /w
hl/torch_stable.html
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /w
hl/torch_stable.html
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /w
hl/torch_stable.html
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /w
hl/torch_stable.html
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /p
ypi/simple/torch/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /p
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /p
ypi/simple/torch/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /p
ypi/simple/torch/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /p
ypi/simple/torch/
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch

我们可以去下载whl二进制包进行安装
二进制包下载
在这里插入图片描述
在这里插入图片描述
但是请注意你自己的环境和版本,下载后我们找到包的位置

PS D:\项目源码\临时部署\operational_platform> cd D:\项目源码\垃圾文件
PS D:\项目源码\垃圾文件> pip install torch-1.3.1+cpu-cp37-cp37m-win_amd64.whl
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Processing d:\项目源码\垃圾文件\torch-1.3.1+cpu-cp37-cp37m-win_amd64.whl
Requirement already satisfied: numpy in c:\users\wanghui\appdata\local\programs\python\python37\lib\site-packages (from torch==1.3.1+cpu) (1.16.4)
Installing collected packages: torch
Successfully installed torch-1.3.1+cpu
PS D:\项目源码\垃圾文件> 

看吧,这样就安装好了!此方法适用类似所有情况!!!

  • 9
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

IT小辉同学

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

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

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

打赏作者

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

抵扣说明:

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

余额充值