38

I have the anaconda package and run Spyder. Here is my system information:

anaconda                  2018.12                  py37_0

Python                    3.7.1

pip                       18.1

Dell Inspiron 13 7000 64-bit

I am unable to install anything with pip from the command prompt. I get the following when trying to install numpy for instance (which I already have through anaconda):

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

Requirement already satisfied: numpy in c:\users\uday rallabhandi\anaconda3\lib\site-packages (1.15.4)

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

Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

Please help me understand why this is happening.

2

11 Answers 11

34

Here was my process to correct the error, on Windows 10 with Anaconda:

  1. Added the following paths to my environment variables:
  • /AppData/Local/Continuum/Anaconda3
  • /AppData/Local/Continuum/Anaconda3/Scripts
  • /AppData/Local/Continuum/Anaconda3/Library
  • /AppData/Local/Continuum/Anaconda3/Library/Bin

At this stage, the error message was still there.

  1. From Anaconda Prompt, I installed the latest version of pip:

    python -m pip install --upgrade pip
    

This appeared to correct the DLL conflict.

5
  • 2
    Worked for me on Win10. Why is /Library not added to PATH by anaconda3 by default?! Commented Apr 8, 2020 at 17:16
  • 1
    This solution was the only one that works for me thank you very much. Win 10 pro Commented Aug 3, 2020 at 3:44
  • 3
    that solution works. that file anaconda3\Library\bin\libssl-1_1-x64.dll should be in $PATH
    – ivan866
    Commented Aug 16, 2020 at 20:16
  • Worked for me as well but I didn't have to upgrade pip (Windows 10). @DmitryAvtonomov I think Anaconda installer now gives you the option whether to add to path or not. By defualt the option is not selected and it's "not recommended"
    – A.Shoman
    Commented Jul 3, 2021 at 15:20
  • If the environment is within QGIS and Anaconda is not in the equation at all, is there an alternative? None of these solutions work for me.
    – CNIDog
    Commented Feb 22, 2022 at 17:26
19

I had exactly the same problem. My computer is exactly the same and the versions of Python and pip are also the same.

It's a dll conflict with libeay32.dll.

I can solve this problem by adding dir path of python which has libeay32.dll (in my case C:\Users\Gabriel\Anaconda3\pkgs\openssl-1.1.1a-he774522_0\Library\bin) in system environment as topmost position.

1
  • i have: .../pkgs/openssl-1.1.1a-he774522_0, but no libeay32.dll. where else can i find it for win 8.1?
    – Ray Tayek
    Commented Feb 7, 2019 at 8:06
10

I had the same issue when I created a new environment in anaconda, activated it and tried to install a library with pip. What was missing was:

conda install pip

then everything worked for me.

2
  • Not the same situation as I already had a currently operational pip, but something did get mucked up by me. Either way, this also served to solve my issue before taking the nuclear approach! thanks!
    – Maxim
    Commented Nov 10, 2022 at 22:37
  • Very helpful! Just to add to this, the environment was working fine before but probably openssl updated and pip could not update itself, so once I used "conda upgrade pip" it updated the openssl package and then pip started working fine again.
    – myx
    Commented May 10 at 18:49
7

Try your install/update with pip3 instead of pip.

0
7

I do not have libeay32.dll in bin folder either, but after adding C:\Users\<user name>\Anaconda3\pkgs\openssl-1.1.1a-he774522_0\Library\bin to the top of path, it is working. This is on Windows 10 64-bit.

6

Activate your base conda environment:

conda activate base

4

Adding "<Path to miniconda or anaconda>\Library\bin" folder to PATH solved this problem for me.

1

Add <Path to miniconda or anaconda>\Library\bin folder to PATH or
cd <Path to miniconda or anaconda>\Library\bin>

0

Activating the base and then activated my Django environment.

(Django_env) (base) C:\virtual_environment\Django_env> , which actually worked for me.

0

I need to add a different answer here:

For so many years moving forward, we have a lot of new python versions(up to python3.13 now), but some users are still using old linux version like centos-6, which has end its life.

On those old linux, please remember do not install any new python versions, for example you should install 3.6.5 on centos 6.8, if you try to install a python3.7.x or a 3.6.14 import ssl might fail even if you've installed all the ssl deps(libssl/openssl and it's dev).

In the end, upgrade your os version asap.

-1

just a note how to find wich library is missing

$ python -m ssl
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.9/ssl.py", line 99, in <module>
    import _ssl             # if we can't import it, let the error propagate
ImportError: libssl.so.1.1: cannot open shared object file: No such file or directory
1
  • Everyone above is talking about Windows, but these are Linux paths. Also, I tried this on my Windows machine - python -m ssl runs without error, but I still can't install anything using pip.
    – jon_two
    Commented Sep 5, 2023 at 10:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.