[PYTHON] Solution if pip gives [SSL: CERTIFICATE_VERIFY_FAILED]

Background

When I tried to install the package with pip, an error occurred and I could not install it. I got the same error for all packages, and I thought it was a bug in pip and tried to update pip, but I couldn't do that either. Even if I re-install Python, it doesn't work.

environment

OS:Windows10 python version:3.8.2

error contents

PS C:\Users\user> python -m pip install -U pip
WARNING: 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:1108)'))': /simple/pip/
(abridgement)

There is an SSL error. This error is on the company PC, so it may be stuck in some security. When I searched for the error message, the error was resolved by the method described on the following site. https://github.com/pypa/pip/issues/5448

Solution

Create% APPDATA% \ pip \ pip.ini and write the following.

[global]
trusted-host = pypi.python.org
               pypi.org
               files.pythonhosted.org

Recommended Posts

Solution if pip gives [SSL: CERTIFICATE_VERIFY_FAILED]
What to do if pip gives a DistributionError in Homebrew
Solution if MySQL cannot start
[youtube-dl] python3 SSL error (CERTIFICATE_VERIFY_FAILED)
# Solution when pip install gives an error when using Anaconda on Windows 10
Read this if you get SSL related errors with pip install! !! !!