When I'm trying to install PIP using the downloaded package from bootstrap.pypa.io, I'm getting SSL Certificate error. I've followed other posts and tried doing this by disabling the certificate check in /etc/python/cert-verification.cfg
and tried using PYTHONHTTPSVERIFY=0
but this doesn't seem to work and finally I have decided to ask this questions because other posts don't really help my case.
I have the following Environment:
OS: centos-release-7-5.1804.1.el7.centos.x86_64
Python Packages:
[root@localhost ~]# yum list installed|grep python dbus-python.x86_64 1.1.1-9.el7 @anaconda libselinux-python.x86_64 2.5-12.el7 @anaconda newt-python.x86_64 0.52.15-4.el7 @anaconda python.x86_64 2.7.5-69.el7_5 @updates python-backports.x86_64 1.0-8.el7 @base python-backports-ssl_match_hostname.noarch python-configobj.noarch 4.7.2-7.el7 @anaconda python-decorator.noarch 3.4.0-3.el7 @anaconda python-firewall.noarch 0.4.4.4-14.el7 @anaconda python-gobject-base.x86_64 3.22.0-1.el7_4.1 @anaconda python-iniparse.noarch 0.4-9.el7 @anaconda python-ipaddress.noarch 1.0.16-2.el7 @base python-libs.x86_64 2.7.5-69.el7_5 @updates python-linux-procfs.noarch 0.4.9-3.el7 @anaconda python-perf.x86_64 3.10.0-862.9.1.el7 @updates python-pycurl.x86_64 7.19.0-19.el7 @anaconda python-pyudev.noarch 0.15-9.el7 @anaconda python-schedutils.x86_64 0.4-6.el7 @anaconda python-setuptools.noarch 0.9.8-7.el7 @base python-slip.noarch 0.4.0-4.el7 @anaconda python-slip-dbus.noarch 0.4.0-4.el7 @anaconda python-urlgrabber.noarch 3.10-8.el7 @anaconda python-wheel.noarch 0.24.0-2.el7 @epel rpm-python.x86_64 4.11.3-32.el7 @anaconda
Following are the steps and Errors:
[root@localhost ~]# curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1604k 100 1604k 0 0 73257 0 0:00:22 0:00:22 --:--:-- 72502 [root@localhost ~]# [root@localhost ~]# PYTHONHTTPSVERIFY=0 python get-pip.py Collecting pip Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)'),)': /packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)'),)': /packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)'),)': /packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)'),)': /packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)'),)': /packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)'),))
I would like to add, Python was pre-installed with the OS and I'm trying to install PIP directly. I tried installed from epel-repo but I get a older version and when I try to update it (because without update, I keep getting error for installing the new version of PIP) I get the same error.
Could anyone suggest how to get this fixed?