requests.exceptions.SSLError: HTTPSConnectionPool pycharm 中使用requests报错

1错误记录

安装完anaconda 以后如果自己创建了新的python环境,并且要使用该环境,那么相关的环境变量就一定要配置上。
配置示例如下(其中python3.7是创建的新的env):
新增环境变量:
PYTHON_3.7=C:\Users\zheng.conda\envs\python3.7
path中添加如下:
%PYTHON_3.7%;
%PYTHON_3.7%\scripts;
%PYTHON_3.7%\Library\bin;

若不配,在使用requets做http请求时会出现如下错误:

requests.exceptions.SSLError: HTTPSConnectionPool(host='xhiot.xhmind.com', port=443): 
Max retries exceeded with url: /seB/api/v1/Token/GetToken 
(Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))

参考连接:https://stackoverflow.com/questions/54135206/requests-caused-by-sslerrorcant-connect-to-https-url-because-the-ssl-module

你可能感兴趣的:(python)