请求(由 SSLError 引起(“无法连接到 HTTPS URL,因为 SSL 模块不可用.")PyCharm 请求网站中的错误 [英] Requests (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.") Error in PyCharm requesting website

查看:23
本文介绍了请求(由 SSLError 引起(“无法连接到 HTTPS URL,因为 SSL 模块不可用.")PyCharm 请求网站中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过 Pycharm 在 Python3 Windows 中使用请求,并收到 SSL Module Not Available 错误

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. -

推荐答案

不知道这是否已经解决,但我在 Anaconda python 3.7.3 和 Windows 10 上的空闲时遇到了类似的问题.通过添加以下内容修复它:

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>Anaconda3scripts
<path>Anaconda3Libraryin

到 PATH 变量.

这篇关于请求(由 SSLError 引起(“无法连接到 HTTPS URL,因为 SSL 模块不可用.")PyCharm 请求网站中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆