请求(由SSLError引起(“由于SSL模块不可用,因此无法连接到HTTPS URL.")PyCharm请求网站中的错误 [英] Requests (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.") Error in PyCharm requesting website
问题描述
在Python3 Windows中通过Pycharm使用请求,并收到SSL模块不可用错误
Using requests in Python3 Windows via Pycharm, and receiving SSL Module Not Available Error
我花了数小时试图找出可能导致这种情况的原因.我已经重新安装了Anaconda,但我完全卡住了.当运行以下内容
I've spent hours trying to figure out what could be causing this. I've reinstalled Anaconda, and I am completely stuck. When running the following
def Earlybird(daycount):
url = 'https://msft.com'
response = requests.get(url)
print(response)
Earlybird()
我收到错误
requests.exceptions.SSLError: HTTPSConnectionPool(host='msft.com',
port=443): Max retries exceeded with url: / (Caused by SSLError("Can't
connect to HTTPS URL because the SSL module is not available."))
我不知道是什么原因造成的.由于Anaconda是最近安装的,因此我认为一切都是最新的,因此我不确定这是否指向错误的SSL?我对python有点陌生,因此感谢您的耐心配合. -
I have no idea what could be causing this. As Anaconda is a recent install, I would assume everything would be up-to-date, so I'm unsure if this is pointing to the wrong SSL ? I am a bit new to python, so thanks for your patience. -
推荐答案
尚不知道此问题是否已解决,但是我在Windows 10上遇到了Anaconda python 3.7.3和Idle的类似问题,并通过添加以下内容进行了修复:
Don't know if this has been solved yet but I was getting similar problems with Anaconda python 3.7.3 and Idle on Windows 10. Fixed it by adding:
<path>\Anaconda3
<path>\Anaconda3\scripts
<path>\Anaconda3\Library\bin
到PATH变量.
这篇关于请求(由SSLError引起(“由于SSL模块不可用,因此无法连接到HTTPS URL.")PyCharm请求网站中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!