Pip install failing for Python 2.7 with SSL error in Openwrt

I am trying to install pip packages on an arm64 Openwrt based platform
Pip Version - 20.0.2
Openssl Version 1.0.2q
Python - 2.7.13 - Not Using python3 since the option to include python3-pip is not there in the Openwrt package I am using

On trying to install pip packages the following error happens and packages failed to download

*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/six/*
*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/six/*
*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/six/*
*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/six/*
*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/six/*
*Could not fetch URL https://pypi.org/simple/six/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/six/ (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 six (from versions: none)*
*ERROR: No matching distribution found for six*
*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*

Tried to install again using the following option for SSL independent
*pip install six --trusted-host pypi.org*

Still the issue remains

If i try to import ssl in python I am not able to do that and it gives following message

*_>>> import ssl*
*Traceback (most recent call last):*
*File "", line 1, in*
*File "/usr/lib/python2.7/ssl.py", line 98, in*
*import _ssl # if we can't import it, let the error propagate*
*ImportError: Error relocating /usr/lib/python2.7/lib-dynload/ssl.so: SSL_CTX_set_next_proto_select_cb: symbol not found*

I have tried to upgrade openssl with
*opkg upgrade openssl*
But no upgrade happened

Can anyone please suggest a solution to solve the issue of installing pip packages?

With the EOL of Python2 that's a bug. I wouldn't waste time getting a Python2-only package to work. Is this an official OpenWrt package?
For the 2to3 transition for official packages have a look here: https://github.com/openwrt/packages/issues/8893

Is this an official OpenWrt package?
This is a customized version of OpenWrt Chaos Calmer 15.05.1

With the release of OpenWrt 18.06, the old OpenWrt 15.05 release is marked end of life and will not get any support any more, not even for severe security problems.

from here

I don't know what modifications you are talking about, but trying to run an EOL Python version on an EOL OS is definitely the point where you should switch to a current Python and OpenWrt version.

1 Like