1

I've installed python 3.7 and pip, but running pip gives me an error:

pip3.7 install  django
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting django
  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/
  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/
  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/
  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/
  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
  Could not find a version that satisfies the requirement django (from versions: )
No matching distribution found for django
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've also tried to install openssl-devel:

root@server.reviewlyft.com [tmp]# yum install openssl-devel
Loaded plugins: fastestmirror, security, universal-hooks
Setting up Install Process
Loading mirror speeds from cached hostfile
 * EA4: 70.87.220.252
 * cpanel-addons-production-feed: 70.87.220.252
 * cpanel-plugins: 70.87.220.252
Package openssl-devel-1.0.1e-57.el6.x86_64 already installed and latest version
Nothing to do

but that didn't do anything.

Basically I am trying to install django for a web server and the ssl problem is preventing that. What is fix or a better path? Sorry for my naivety.

Also any instructions I've found were for python 2.x or on a newer RHEL version. I've looked at https://developers.redhat.com/blog/2018/08/13/install-python3-rhel/ but I don't understand it well enough to try it and not break anything as this server is in use.

  • 2
    Do you want this question answered on here, SuperUser, or both? Please don't post on multiple sites :-) – garethTheRed Jun 11 '19 at 20:01
  • I don't care, I just didn't know where it was to be posted, and I've gotten no answers on either. – joannarch Jun 11 '19 at 20:04
  • 2
    It may take a while to get an answer. Cross-posting within an hour of the 1st post isn't on form. Have a read of this on Meta for guidance. It's probably best to delete one of them. – garethTheRed Jun 11 '19 at 20:42
  • You seem to not have the python3 SSL module, which is not directly provided by openssl-devel (you would need openssl-devel to build python with SSL support). I am curious how you got python-3.7 installed in the first place as it requires a version of OpenSSL that is not supported on your version of RHEL. Which could mean you have a custom version of OpenSSL installed somewhere outside of the system packages. What does the command python -c "import ssl;print(ssl.OPENSSL_VERSION)" output for you? – GracefulRestart Jun 12 '19 at 0:31
  • python3.7 -c "import ssl;print(ssl.OPENSSL_VERSION)" Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/local/lib/python3.7/ssl.py", line 98, in <module> import _ssl # if we can't import it, let the error propagate ModuleNotFoundError: No module named '_ssl' – joannarch Jun 12 '19 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.