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‘)”的问题
418 0
|
并行计算 Linux PyTorch
RuntimeError: CUDA error: device-side assert triggered
我在运行PyG和transformers代码时两次遇到了这一问题,在此加以记录。
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
|
6月前
|
Java 开发工具 git
【Python】已解决:ERROR: No matching distribution found for JPype1
【Python】已解决:ERROR: No matching distribution found for JPype1
387 0
|
6月前
|
Java Python
【Python】已解决:ERROR: No matching distribution found for JPype
【Python】已解决:ERROR: No matching distribution found for JPype
480 0
|
8月前
ERROR: No matching distribution found for tb-nightly
ERROR: No matching distribution found for tb-nightly
287 1
加载模型出现-RuntimeError: Error(s) in loading state_dict for Net:unexpected key(s) in state_dict: XXX
加载模型出现-RuntimeError: Error(s) in loading state_dict for Net:unexpected key(s) in state_dict: XXX
589 0
|
8月前
|
机器学习/深度学习 人工智能
【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]=
|
8月前
|
Ubuntu iOS开发 MacOS
Could not enumerate video devices (or none found).解决办法
Could not enumerate video devices (or none found).解决办法
117 0
成功解决ValueError: Found input variables with inconsistent numbers of samples: [86, 891]
成功解决ValueError: Found input variables with inconsistent numbers of samples: [86, 891]

热门文章

最新文章