pip install torch -i https://pypi.org/
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
我们举一反三,出现类似问题,我们第一选择就是切换镜像站,提供如下:
以下是一些常见的中国国内的Python软件包镜像站,你可以使用其中的任何一个来加速pip安装和更新:
-
清华大学镜像站:
- 主页:https://pypi.tuna.tsinghua.edu.cn/simple
- pip使用方法:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple <package-name>
-
阿里云镜像站:
- 主页:http://mirrors.aliyun.com/pypi/simple/
- pip使用方法:
pip install -i http://mirrors.aliyun.com/pypi/simple/ <package-name>
-
豆瓣镜像站:
- 主页:https://pypi.douban.com/simple/
- pip使用方法:
pip install -i https://pypi.douban.com/simple/ <package-name>
-
中国科技大学镜像站:
- 主页:https://pypi.mirrors.ustc.edu.cn/simple/
- pip使用方法:
pip install -i https://pypi.mirrors.ustc.edu.cn/simple/ <package-name>
你可以选择其中一个镜像站并将其设置为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:\项目源码\垃圾文件>
看吧,这样就安装好了!此方法适用类似所有情况!!!