[PYTHON] The story of when I was addicted to Caused by SSLError ("Can't connect to HTTPS URL because the SSL module is not available.")

Introduction

For web scraping practice I got a sample code and tried scraping I was addicted to the exception, so make a note of the event and the solution.

Event

[Python] Get stock price data by scraping When I executed the script, the error ↓↓ occurred and the process could not proceed. The PC was just after returning to the factory default, so I'm quite impatient.

Script execution result error message


requests.exceptions.SSLError: HTTPSConnectionPool(host='***.co.jp', 
port=443): Max retries exceeded with url: / (Caused by SSLError("Can't 
connect to HTTPS URL because the SSL module is not available."))

environment

anaconda 1.9.12 python 3.8.3

Solution

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

I fixed it by putting the following path in the environment variable.

Environment variable


%USERPROFILE%\Anaconda3
%USERPROFILE%\Anaconda3\scripts
%USERPROFILE%\Anaconda3\Library\bin

Specifically, it looks like this. スクリーンショット 2020-09-25 105532.png

in conclusion

Looking back now, even though the python execution environment is anaconda3, I started python from vscode. I wondered if the package installed by anaconda was not referenced. Anyway, I'm glad I solved the problem.

Recommended Posts

The story of when I was addicted to Caused by SSLError ("Can't connect to HTTPS URL because the SSL module is not available.")
When I try to use pip, SSL module is not available.
The story I was addicted to when I specified nil as a function argument in Go
A story that is a little addicted to the authority of the directory specified by expdp (for beginners)
The story that the version of python 3.7.7 was not adapted to Heroku
The record I was addicted to when putting MeCab on Heroku
I want to display the number of num_boost_rounds when early_stopping is applied using XGBoost callback (not achieved)
A story I was addicted to when inserting from Python to a PostgreSQL table
A story I was addicted to trying to get a video url with tweepy
[Python] I was addicted to not saving internal variables of lambda expressions
Log when I was worried that I could not connect to Wi-Fi on Linux
I was in trouble because the behavior of docker container did not change
AtCoder AGC 041 C --I was addicted to the full search of Domino Quality
A story that I was addicted to when I made SFTP communication with python
A story that was convenient when I tried using the python ip address module
Note that I was addicted to npm script not passing in the verification environment
I can't find the clocksource tsc! ?? The story of trying to write a kernel patch
When "zipimport.ZipImportError: can't decompress data; zlib not available" appears when installing the version of pyenv
When I deployed the Django app to Heroku, I got Module Not Found: <project-name> .wsgi.
The story when I was using IntelliJ on Linux and could not input Japanese
I realized that it is nonsense to use the module without thinking because it is convenient.