Requests (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.") Error in PyCharm requesting website
Solution 1
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.
Solution 2
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! "
Solution 3
Windows Users need to set below paths:
..\Anaconda3
..\Anaconda3\scripts
..\Anaconda3\Library\bin
Per user:
- Open Environment variable
- Click User Variable
- Close command prompt if already open and reopen it
System wide (requires restart):
- Open Environment variable
- Click System Variable
- Restart Windows
Solution 4
I got it solved by installing OpenSSL according to the following recommendation: https://github.com/conda/conda/issues/8046#issuecomment-450515815
Corresponding ticket in the conda repository: 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/).
Solution 5
this issue was driving me insane until i found this post which said to do
brew upgrade python3
(not using pycharm, using sublime)
Related videos on Youtube
Frank Drin
Updated on May 05, 2022Comments
-
Frank Drin about 2 years
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. -
-
Matej Novosad almost 5 yearsInstalled this slproweb.com/download/Win64OpenSSL-1_1_1c.exe from OpenSSL. Solved my problem.
-
till Kadabra about 2 yearsLink is broken.
-
-
Stepan Yakovenko almost 5 yearsthere are many binaries there, which one exactly? It would be cool to make exact link or screenshot. I used first link with MSI file and it worked, thank you friend: slproweb.com/download/Win64OpenSSL_Light-1_1_1b.msi
-
hui chen almost 5 yearsAlthough don't know why we have to export multiple paths, but it works for me, thanks.
-
ERJAN over 4 yearsTHIS WORKED FOR ME! not "execstack ..." cmd but this one! adding path/anaconda3/library/bin worked for me
-
Alex Dana about 4 yearsNot sure to understand how/where do we have to add this 3 paths ?
-
Paul Stevens about 4 yearsAlex - add these items to the PATH environment variable (e.g see Mukesh Methaniya/Neuron answer below)
-
Henry Navarro about 4 yearsWhere do I have to add these paths? I am trying to run a python code from specific folder using
python get-pip.py
-
Kevin Vasko almost 4 yearsSame versions of everything for me. Windows 10 Miniconda which had 3.7.4. Fixed with this solution.
-
Lou over 3 yearsThis worked for me too! Thanks for going through all the debugging steps :)
-
Sergey Shubin over 3 years
-
Loïc G. over 3 yearsJust needed to
Add Interpreter
then to chooseexisting environnement
and it did the trick. No need to recreate the project. -
EliSquared about 3 yearsWorked on
Anaconda Python 3.8.3
on aWindows 10
server. Just had to alter the localpath
environment variable. -
Denziloe almost 3 yearsNot sure what "not a reasonable request" means, but it is actually generally good practice for avoiding weird errors, and it resolves this error too. It's not hard, just enter
code
in the prompt to launch VS Code. -
Haitham Gamal almost 3 yearsWorks for me. Thank you.
-
Adam DS over 2 yearsGreat thank you for this! VSCode just completed its monthly auto-update on my machine and all of a sudden this problem appeared and your solution worked perfectly :)
-
Tim John over 2 yearsThis solution is much better than setting ssl_verify: false as suggested in other posts (e.g., stackoverflow.com/questions/42563757/…). Apparently, that solution has security issues
-
Micah over 2 yearsWhere do you set the path? Add "new" and then make a path for each of the Anaconda3 folders?
-
Micah over 2 yearsIt seems like my User variables only allow for one PATH, it keeps replacing my old PATH so I can't get all 3. Can Anyone help me?
-
Micah over 2 yearsstackoverflow.com/questions/60974818/… This solved my problem: Use ; to separate each path.
-
An old man in the sea. over 2 yearsI added so many environment variables, installed the OpenSSL thingy, and nothing worked... Until I tried your last solution. :)))