Python Forum
Cannot update or install anything with pip, SSL error - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Cannot update or install anything with pip, SSL error (/thread-12634.html)



Cannot update or install anything with pip, SSL error - nickystixx45 - Sep-04-2018

Hi everyone, this is my first time posting on here and I really need help with this problem. I've had Python and pip on my PC since I got it about a year ago and never really used pip that much until recently. I'm working on a project with my friend in PyCharm and I need to install some requirements for this project but every time I try to install them or do anything with pip I get this message:

Microsoft Windows [Version 10.0.17134.254]
© 2018 Microsoft Corporation. All rights reserved.

C:\Users\Nick>python -m pip install --upgrade pip
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)'))': /simple/pip/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)'))': /simple/pip/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)'))': /simple/pip/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)'))': /simple/pip/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)'))': /simple/pip/
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(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)'))) - skipping
Requirement already up-to-date: pip in c:\program files\python37\lib\site-packages (10.0.1)
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(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)'))) - skipping

It doesn't matter what I try to do with pip, the SSL error comes up every time. I can't even update or upgrade it. Yesterday I uninstalled my older versions of Python and downloaded 3.7 and 3.6.6 and downloaded pip with them, it did nothing. I have tried every solution I could find and nothing works. I don't know what happened or why pip isn't working correctly. If you have something I can try I would greatly appreciate it!


RE: Cannot update or install anything with pip, SSL error - snippsat - Sep-04-2018

Try:
python -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --upgrade pip
Bug report.
Quote:It appears the issue is a corporate proxy/firewall/mitm-box is not allowing traffic to pypi.org and/or files.pythonhosted.org.

Not related but our install tutorial.
Python 3.6/3.7 and pip installation under Windows


RE: Cannot update or install anything with pip, SSL error - nickystixx45 - Sep-04-2018

Thanks for the response. I tried that and this is what it said:

Microsoft Windows [Version 10.0.17134.254]
© 2018 Microsoft Corporation. All rights reserved.

C:\Users\Nick>python -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --upgrade pip
Collecting pip
Downloading https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 4.7MB/s
Installing collected packages: pip
Found existing installation: pip 10.0.1
Uninstalling pip-10.0.1:
Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\\program files\\python37\\lib\\site-packages\\pip-10.0.1.dist-info\\entry_points.txt'
Consider using the --user option or check the permissions.

You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.


RE: Cannot update or install anything with pip, SSL error - snippsat - Sep-04-2018

Run cmd as Administrator.


RE: Cannot update or install anything with pip, SSL error - nickystixx45 - Sep-05-2018

Running cmd as admin did upgrade pip to version 18.0 but I still get the same ssl error when I try to install anything with pip, admin or not.


RE: Cannot update or install anything with pip, SSL error - ThatGuyDuncan - Mar-25-2019

(Sep-05-2018, 12:56 AM)nickystixx45 Wrote: Running cmd as admin did upgrade pip to version 18.0 but I still get the same ssl error when I try to install anything with pip, admin or not.

Did you ever resolve?


RE: Cannot update or install anything with pip, SSL error - nickystixx45 - Mar-26-2019

(Mar-25-2019, 07:57 PM)ThatGuyDuncan Wrote:
(Sep-05-2018, 12:56 AM)nickystixx45 Wrote: Running cmd as admin did upgrade pip to version 18.0 but I still get the same ssl error when I try to install anything with pip, admin or not.

Did you ever resolve?

Yes. Whenever I need to install or update something I have to put: pip install --trusted-host=pypi.org --trusted-host=files.pythonhosted.org --user {name of whatever I'm installing}

I found this solution here: https://github.com/pypa/pip/issues/5363