Using requests in Python3 Windows via Pycharm, and receiving SSL Module Not Available Error
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()
I receive the error
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."))
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. -
To Solve Caused by SSLError(“Can't connect to HTTPS URL because the SSL module is not available.”) Error If you are using anaconda then Then add this to PATH variable <path>\Anaconda3 <path>\Anaconda3\scripts <path>\Anaconda3\Library\bin Second Solution is Just copy this file libcrypto-1_1-x64. * libssl-1_1-x64.
This module provides access to Transport Layer Security (often known as “Secure Sockets Layer”) encryption and peer authentication facilities for network sockets, both client-side and server-side. This module uses the OpenSSL library.
The error states that the SSL python module is not available; meaning you either don't have an appropriate ssl lib installed (probably not since you state the system python can pip install fine), or the python you built from source or otherwise installed doesn't include the ssl module.
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>\Anaconda3\scripts
<path>\Anaconda3\Library\bin
to the PATH variable.
I am on Windows 10, I had the problem with a new fresh installation of Anaconda on python 3.7.4, this post on github solved my problem:
( source: https://github.com/conda/conda/issues/8273)
I cite:
" My workaround: I have copied the following files
libcrypto-1_1-x64.*
libssl-1_1-x64.*
from D:\Anaconda3\Library\bin to D:\Anaconda3\DLLs.
And it works as a charm! "
Windows Users need to set below paths:
..\Anaconda3
..\Anaconda3\scripts
..\Anaconda3\Library\bin
Per user:
System wide (requires restart):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With