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. -
Note: This issue was fixed on windows 10 I was facing same issue with virtual environment on windows 10. Issue was solved with running CMD as administrator and creating new virtual environment.
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:
to the PATH variable.
I got it solved by installing OpenSSL according to the following recomendation: https://github.com/conda/conda/issues/8046#issuecomment-450515815
Corresponding ticket in the conda repo: https://github.com/conda/conda/issues/8046
Update: the problem (in PyCharm) should be solved in 2019.1 version (Early Access Preview build is already available https://www.jetbrains.com/pycharm/nextversion/).
I don't have Anaconda so the steps I took are:
brew uninstall python3
brew install python3
Your Xcode (10.2) is too outdated. Please update to Xcode 11.3 (or delete it). Xcode can be updated from the App Store.
**So, I deleted Xcode since no update would show, then I reinstalled it.xcode-select --install
after. If you don't.. you'll get an error:The following formula python cannot be installed as binary package and must be built from source. Install the Command Line Tools: xcode-select --install
brew install python3
and it completed successfully.Used this script just to see if it works
Ran the script python3 and python3.7 and output was
<Response [200]>
instead of SSLError.I've installed the binaries from here: https://slproweb.com/products/Win32OpenSSL.html This site is mentioned on the official OpenSSL wiki. It solved my problem
Solved by doing the following in my windows 10: