【发布时间】: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