【问题标题】:In VSCode, Requests throw SSLError despite verify=false在 VSCode 中,尽管 verify=false,请求仍会抛出 SSLError
【发布时间】:2021-08-27 03:46:32
【问题描述】:

奇怪的是,在 VSCode jupyter notebook 上,我可以很好地使用请求。但是,在 VSCode python 窗口上,即使我使用 verify=False,它也会不断抛出 SSL 错误。

我运行的代码:

import requests
r = requests.get('https://www.webpage.com/', verify=False)

我得到的错误:

Exception has occurred: SSLError
HTTPSConnectionPool(host='www.americandragon.com', port=443): Max retries exceeded with url: /LatinIndividualHerbIndex2.html (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))

During handling of the above exception, another exception occurred:


During handling of the above exception, another exception occurred:

  File "C:\Users\breno\Documents\BBrito\code\Klaus\get_herbs.py", line 11, in <module>
    r = requests.get('https://www.americandragon.com/LatinIndividualHerbIndex2.html', verify=False)

【问题讨论】:

  • 您似乎有一个损坏的 Python 安装,其中 ssl 模块不工作或丢失。

标签: python python-3.x ssl visual-studio-code python-requests


【解决方案1】:

您在jupyter notebookpython file 之间使用不同的python 解释器,对吗?

在您为 python 文件选择的环境中,SSL 模型似乎存在一些问题。

您能否切换到在Jupyter NoteBook 中为您的python 文件使用的python 解释器?

【讨论】:

    猜你喜欢
    • 2017-01-10
    • 2016-02-05
    • 1970-01-01
    • 1970-01-01
    • 2017-10-20
    • 1970-01-01
    相关资源
    最近更新 更多