0

I was getting an error when trying to install a package via conda so I reinstalled Anaconda. Now no matter what I do, when I try to install a package with either pip or conda I get an error. The error for pip is:

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

I've even completely uninstalled Anaconda, removed all Path variable values, and install a completely different version, but I still got the same error. All the answers that Google brought up were about how there must be incorrect Path variable values assigned. If this was the case, I could simply just use the Anaconda prompt, but the same error appears there too, which nobody seems to have an answer for. Any ideas on how to fix this? I've tried following the accepted answer here to re-add the SSL module with no luck or given error. I've tried running conda activate before I run pip, using pip3 instead of pip and many other things. I'm on a Windows 10 PC, just install a fresh version of Anaconda 3, 2019.10 running Python 3.7.4.

EDIT

I tried using Miniconda and the error still persisted. I think the issue is with my machine.

Community
  • 1
  • 1
Jack
  • 1,893
  • 1
  • 11
  • 28

3 Answers3

1

After much trial and error, I finally found my issue. All I had to do was delete libssl-1_1-x64.dll and libcrypto-1_1-x64.dll from C:/Windows/System32/. I got this answer from this Github issue here so if this doesn't work out for you, there are a lot of other possible solutions.

Jack
  • 1,893
  • 1
  • 11
  • 28
0

Try setting it as trusted hosts. Run this -

$ pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org pip setuptools

To add trusted hosts & proxy in config-

Add the below code in %APPDATA%\pip\pip.ini in case of per-user configuration OR %VIRTUAL_ENV%\pip.ini in case of virtualenv OR C:\ProgramData\pip\pip.ini in case of site-wide

[global] trusted-host = pypi.python.org pypi.org files.pythonhosted.org

Hmz
  • 56
  • 6
  • Thanks for your answer, still getting the same error though, even after setting it as trusted hosts. – Jack Oct 19 '19 at 20:56
  • Try checking your PATH variable. – Hmz Oct 19 '19 at 21:48
  • I have the following values for the PATH variable: C:\Users\user\Anaconda3, C:\Users\user\Anaconda3\Library\mingw-w64\bin, C:\Users\user\Anaconda3\Library\usr\bin, C:\Users\user\Anaconda3\Library\bin, C:\Users\user\Anaconda3\Scripts, C:\Users\user\Anaconda3\pkgs\openssl-1.1.1d-he774522_2\Library\bin, and C:\Users\user\Anaconda3\Library – Jack Oct 19 '19 at 22:03
  • Any more I should try added? – Jack Oct 19 '19 at 22:03
  • I mean check the entire PATH, something might be broken at the PATH level. And if not then I'm guessing there is a conflict of `.dll` files because of the installation of 2 different versions, one of the conflicting dll's might be resulting in this. – Hmz Oct 20 '19 at 03:52
  • Hmz, I definitely think that it is a conflict with the `.dll` files, any idea on how I could fix that? – Jack Oct 20 '19 at 12:41
0

PyPI uses https now, so you need ssl support. If your system Python doesn't have it, your virtualenv won't have it either. With Python 3, you should be able to import an ssl module:

import ssl

If it won't work, you might need to delete the virtualenv directory and then re-install it.

Taranus
  • 21
  • 6
  • When I do that, I get the error `ImportError: DLL load failed: The specified procedure could not be found.` – Jack Oct 19 '19 at 22:00