requests.exceptions.SSLError: HTTPSConnectionPool(host=‘XXX‘, port=443)

运行代码

import requests

response = requests.get("https://www.baidu.com")
print(response.status_code)

会报错。
解决办法:
1、先检查是否已安装requests的依赖安装包:

pip install cryptography

pip install pyOpenSSL

pip install certifi

2.如果安装后依然报错:
则在请求后面加上verify=False就可以

response = requests.get("https://www.baidu.com",verify=False)

你可能感兴趣的:(Error)