【问题标题】:SSL error while installing flask in vs code在 vs code 中安装 flask 时出现 SSL 错误
【发布时间】:2023-02-02 09:59:53
【问题描述】:

我试图在虚拟环境中的 vs code 中安装 flask,但出现了一些 SSL 错误。 在我的虚拟环境中,我尝试通过编写来安装烧瓶

pip install flask

然后我得到这个错误,

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)'))': /simple/flask/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after 
connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] 
certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)'))': 
/simple/flask/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after 
connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] 
certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)'))': 
/simple/flask/
: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after 
connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] 
certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)'))': 
/simple/flask/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after 
connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] 
certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)'))': 
/simple/flask/
Could not fetch URL https://pypi.org/simple/flask/: There was a problem confirming the ssl 
certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: 
/simple/flask/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: 
CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate 
chain (_ssl.c:997)'))) - skipping
ERROR: Could not find a version that satisfies the requirement flask (from versions: none)
ERROR: No matching distribution found for flask
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl 
certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max 
retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: 
CERTIFICATE_VERIFY_FAILED] certificate verify failed: self 
signed certificate in certificate chain (_ssl.c:997)'))) - skipping

如何解决这个问题。

当我尝试安装虚拟环境时,我已经在我的 anaconda 提示符和 anaconda 导航器中遇到了相同类型的 SSL 错误,现在我意识到由于这个 SSL 认证错误,我什至无法更新任何包。

anaconda 提示符中的 SSL 错误就像,

CondaSSLError: Encountered an SSL error. Most likely a certificate verification issue.

Exception: HTTPSConnectionPool(host='repo.anaconda.com', port=443): Max retries exceeded with 
url: /pkgs/main/win-64/current_repodata.json 
(Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate 
verify failed: self signed certificate in certificate chain (_ssl.c:997)')))

我确实需要帮助,因为这显然阻碍了我的学习之旅。

【问题讨论】:

  • 您在使用 SSL 拦截代理吗?您的工作地点、学校、医院等可能就是这种情况。当我连接到任何这些站点时,我没有在链中看到任何自签名证书。
  • 对不起,我不明白你说的是什么。你能详细说明一下吗?我在本地计算机上工作与某些问题有关。

标签: python flask visual-studio-code anaconda ssl-certificate


【解决方案1】:

这似乎是因为ssl_verify 阻止了它。您可以尝试运行以下命令并将其更改为false:

conda config --set ssl_verify False

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-02-18
    • 2016-05-13
    • 2016-07-28
    • 2021-03-05
    • 2018-08-05
    • 1970-01-01
    • 2021-08-28
    • 2014-02-24
    相关资源
    最近更新 更多