【发布时间】:2018-07-15 14:35:31
【问题描述】:
我正在尝试在使用自签名 SSL 证书的公司网络上将requests 库安装到我在 PyCharm 中的 Python 环境中。因此,使用 File > Settings > Project > Project Interpreter > Install 安装库失败并出现 HTTPS 错误:
Collecting requests
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection
broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.
VerifiedHTTPSConnection object at 0x0368D5D0>: Failed to establish a new connection:
[Errno 11003] getaddrinfo failed',)': /simple/requests/
Could not find a version that satisfies the requirement requests (from versions: )
No matching distribution found for requests
我尝试通过在我的安装选项中添加--cert C:\COMPANY-CAROOT.pem 来使pip 信任我公司的根证书,这被解释为:
pip install --cert C:\COMPANY-CAROOT.pem requests
我也尝试打开 File > Settings > Project > Server Certificates 并检查自动接受不受信任的证书,但遇到了同样的问题。
如何让 PyCharm 在安装外部库时忽略 SSL 证书错误?
【问题讨论】:
标签: python pip pycharm ssl-certificate