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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章