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
you can always skip https (on your own risk) by explicitly declaring you trust the pypi.org
you can also put it on pip.ini file under [global]
When you got this type of error you just need to re-setup or re-config your python setup using given commands:
sudo apt install build-essential
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget
mkdir ~/python-source-files
wget -P ~/python-source-files https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz
tar xvzf Python-3.7.5.tgz
cd Python-3.7.5
./configure --with-openssl
or
./configure --enable-optimizations
sudo make altinstall
I have fixed same issue using these commands.
If you have any query you can ask.