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
目录
相关文章
“Could not find suitable distribution for Requirement.parse(‘XXXX‘)”的问题
“Could not find suitable distribution for Requirement.parse(‘XXXX‘)”的问题
236 0
|
1月前
ERROR: No matching distribution found for tb-nightly
ERROR: No matching distribution found for tb-nightly
26 1
|
1月前
|
机器学习/深度学习 人工智能
【CatBoost报错解决】CatBoostError: Bad value for num feature[non default doc idx=0,feature idx=19]=
【CatBoost报错解决】CatBoostError: Bad value for num feature[non default doc idx=0,feature idx=19]=
|
1月前
|
Ubuntu iOS开发 MacOS
Could not enumerate video devices (or none found).解决办法
Could not enumerate video devices (or none found).解决办法
46 0
|
7月前
|
计算机视觉 Python
ERROR: Could not find a version that satisfies the requirement PIL (from versions: none)
ERROR: Could not find a version that satisfies the requirement PIL (from versions: none)
|
机器学习/深度学习 数据采集
ValueError: Found input variables with inconsistent numbers of samples: [140, 1120] 怎么解决?
这个错误通常发生在机器学习模型的训练中,它表示输入数据的样本数量不一致。在你的情况下,你的输入数据中有两个变量,一个变量的样本数量为140,另一个变量的样本数量为1120,因此这个错误就出现了。 为了解决这个问题,你需要确保所有输入变量的样本数量是相同的。你可以通过以下几种方式来解决这个问题: 检查数据:检查数据是否正确加载,可能会导致数据样本数量不一致。 数据清洗:检查是否有重复的样本或者缺失的样本,如果有则需要对数据进行清洗。 数据对齐:如果你使用了多个数据源,那么你需要对它们进行对齐以确保它们的样本数量一致。 数据重采样:如果数据中有不均衡的样本数量,你可以考虑使用数据重采样方
737 0
|
Unix Linux 异构计算
成功解决 ERROR: An error occurred while performing the step: “Building kernel modules“. See /var/log/nv
成功解决 ERROR: An error occurred while performing the step: “Building kernel modules“. See /var/log/nv
成功解决 ERROR: An error occurred while performing the step: “Building kernel modules“. See  /var/log/nv
|
TensorFlow 算法框架/工具
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
242 0
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
|
编解码 并行计算
wrf--运行real.exe时报错:“Could not find level above ground“ error
在修改wrf初始场资料时,如果做了带通滤波处理,会发现在运行real.exe时报错:“Could not find level above ground” error 。
wrf--运行real.exe时报错:“Could not find level above ground“ error
成功解决ValueError: Found input variables with inconsistent numbers of samples: [86, 891]
成功解决ValueError: Found input variables with inconsistent numbers of samples: [86, 891]