我正在尝试使用 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
命令来处理该问题并让 SSL 验证发挥作用pip
配置文件来处理该问题,即 /path/to/my/env/pip.conf
不幸的是,有这样的
pip.conf
文件:
trusted-host = pypi.python.org
pypi.org
files.pythonhosted.org
download.pytorch.org
不起作用,似乎被
pip
忽略
C:\Users
如果您运行此命令,请说:
pip config set global.trusted-host "pypi.org files.pythonhosted.org pypi.python.org"
它将更新上述文件。