skip to Main Content

I’m connecting to a virtual server that I rented through ssh.

Its os is Debian 8.2.

I installed python 3.7 and pip.

When I want to install any package with pip I get this error:

pip install django

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/django/ 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/django/
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/django/ 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/django/ 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/django/ Could not
fetch URL https://pypi.org/simple/django/: There was a problem
confirming the ssl certificate: HTTPSConnectionPool(host=’pypi.org’,
port=443): Max retries exceeded with url: /simple/django/ (Caused by
SSLError("Can’t connect to HTTPS URL because the SSL module is not
available.")) – skipping ERROR: Could not find a version that
satisfies the requirement django (from versions: none) ERROR: No
matching distribution found for django WARNING: 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

I installed libssl-dev already, and trying pip install ssl won’t help and I get the same error.

any ideas?

2

Answers


  1. you can always skip https (on your own risk) by explicitly declaring you trust the pypi.org

    pip install --trusted-host pypi.org django
    

    you can also put it on pip.ini file under [global]

    [global]
    trusted-host = pypi.org
    
    Login or Signup to reply.
  2. When you got this type of error you just need to re-setup or re-config your python setup using given commands:

    1. sudo apt install build-essential

    2. sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget

    3. mkdir ~/python-source-files

    4. wget -P ~/python-source-files https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz

    5. tar xvzf Python-3.7.5.tgz

    6. cd Python-3.7.5

    7. ./configure --with-openssl
      or
      ./configure --enable-optimizations

    8. sudo make altinstall

    I have fixed same issue using these commands.
    If you have any query you can ask.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search