首页 > 解决方案 > pip 和受信任的主机

问题描述

我正在尝试使用 Python 3.8.6 在 Windows 10 上安装 PyTorch 1.7.0。简单地输入命令时

pip install torch==1.7+cu101

我得到错误:

'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1124)'))': /whl/torch_stable.html

当我做 :

pip install --trusted-host download.pytorch.org torch==1.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html

安装工作完美无缺。

但是,我想:

不幸的是,有这样的pip.conf文件:

trusted-host = pypi.python.org
               pypi.org
               files.pythonhosted.org
               download.pytorch.org

不起作用,似乎被忽略pip

标签: windowspippytorch

解决方案


推荐阅读