Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 478
James Carter Avatar asked Jan 28 '19 02:01

James Carter


People also ask

How do I fix SSL module is not available in Python?

The problem can be caused by DLLs in the Windows\System32 folder (e.g. libcrypto-1_1-x64. dll or libssl-1_1-x64. dll or others) placed there by other software. The fix was installing openSSL from https://slproweb.com/products/Win32OpenSSL.html which replaces the dlls by more recent versions.

What is SSL module in Python?

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.

How PIP ignore SSL certificate install?

You can ignore SSL errors by setting pypi.org and files.pythonhosted.org as well as the older pypi.python.org as trusted hosts.


1 Answers

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.

like image 99
Inigo Selwood Avatar answered Sep 28 '22 18:09

Inigo Selwood