How To Fix Can’t Connect To HTTPS URL Because The SSL Module Is Not Available Error When Executing PIP Install Command In Eclipse

I want to import the python pandas module in my python source code, when I run the python source code in the Eclipse PyDev project, it shows an error on the line of the source code import pandas as pd, the error message is Unresolved import: pd. This means that the python interpreter which I used in my eclipse PyDev project does not install the pandas module.

1. Steps To Reproduce The Can’t Connect To HTTPS URL Because The SSL Module Is Not Available Error.

  1. I follow the article How To Install Python Library ( such as Pandas ) In PyCharm, PyDev Eclipse to install the python pandas library in my Eclipse PyDev project.
  2. When I run the command install pandas in the Manage pip window ( please refer to the above article section 2.2 ), it shows the bellow error message in the text area under the Command to execute input text box.
    WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pandas/
    WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pandas/
    WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pandas/
    WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pandas/
    WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pandas/
    ERROR: Could not find a version that satisfies the requirement pandas (from versions: none)
    ERROR: No matching distribution found for pandas
    Could not fetch URL https://pypi.org/simple/pandas/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pandas/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
    FINISHED
  3. This error confused me a lot of time, after investigating, I finally find the method to fix it.

2. How To Fix The Can’t Connect To HTTPS URL Because The SSL Module Is Not Available Error.

  1. I use the Anaconda in my example, and my python interpreter is an anaconda virtual environment also.
  2. First I open a dos window and run the command conda info to get the Anaconda basic information such as the Anaconda home directory ( it is C:\Users\zhaosong\anaconda3 in this example ).
    C:\Users\zhaosong>conda info
    
         active environment : None
           user config file : C:\Users\zhaosong\.condarc
     populated config files : C:\Users\zhaosong\.condarc
              conda version : 4.10.1
        conda-build version : 3.20.5
             python version : 3.8.5.final.0
           virtual packages : __win=0=0
                              __archspec=1=x86_64
           base environment : C:\Users\zhaosong\anaconda3  (writable)
          conda av data dir : C:\Users\zhaosong\anaconda3\etc\conda
      conda av metadata url : https://repo.anaconda.com/pkgs/main
               channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                              https://repo.anaconda.com/pkgs/main/noarch
                              https://repo.anaconda.com/pkgs/r/win-64
                              https://repo.anaconda.com/pkgs/r/noarch
                              https://repo.anaconda.com/pkgs/msys2/win-64
                              https://repo.anaconda.com/pkgs/msys2/noarch
              package cache : C:\Users\zhaosong\anaconda3\pkgs
                              C:\Users\zhaosong\.conda\pkgs
                              C:\Users\zhaosong\AppData\Local\conda\conda\pkgs
           envs directories : C:\Users\zhaosong\anaconda3\envs
                              C:\Users\zhaosong\.conda\envs
                              C:\Users\zhaosong\AppData\Local\conda\conda\envs
                   platform : win-64
                 user-agent : conda/4.10.1 requests/2.24.0 CPython/3.8.5 Windows/10 Windows/10.0.19041
              administrator : False
                 netrc file : None
               offline mode : False
  3. I add the below 3 paths to my Windows Path environment variable value, then the error is fixed. You should use your own Anaconda path value to replace the one in my example. You can refer to the article How To Set Windows Environment Variables to learn more.
    C:\Users\zhaosong\anaconda3
    
    C:\Users\zhaosong\anaconda3\Scripts
    
    C:\Users\zhaosong\anaconda3\Library\bin
0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x