[PYTHON] Solution when pip install from other than the official website and SSL Error (SSL authentication error) occurs

pip installI think that there are many cases where an ssl authentication error occurs when inserting a package with.

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:1091)'))': /v1/nc_2520839e1f9641b08211a5c85243124a/sudachi/SudachiDict_core-20190718.tar.gz
  WARNING: 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:1091)'))': /v1/nc_2520839e1f9641b08211a5c85243124a/sudachi/SudachiDict_core-20190718.tar.gz
  WARNING: 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:1091)'))': /v1/nc_2520839e1f9641b08211a5c85243124a/sudachi/SudachiDict_core-20190718.tar.gz
  WARNING: 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:1091)'))': /v1/nc_2520839e1f9641b08211a5c85243124a/sudachi/SudachiDict_core-20190718.tar.gz
  WARNING: 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:1091)'))': /v1/nc_2520839e1f9641b08211a5c85243124a/sudachi/SudachiDict_core-20190718.tar.gz
ERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='object-storage.tyo2.conoha.io', port=443): Max retries exceeded with url: /v1/nc_2520839e1f9641b08211a5c85243124a/sudachi/SudachiDict_core-20190718.tar.gz (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091)')))

Like this.

If you download from the official website, you can solve it by forcibly trusting the domain of pipy's official website with the ``` --trusted-host ` `` option.

In particular···,

pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org <package name>

If you download the package from a non-official site, this is not enough

However, if you install from an unofficial site, this may not work (because the domain of that site has nothing to do with the pipy domain).

For example,

pip install https://object-storage.tyo2.conoha.io/v1/nc_2520839e1f9641b08211a5c85243124a/sudachi/SudachiDict_core-20190718.tar.gz

Obviously, if you want to install this package, you need to have the `` --trusted-host``` option trust the domain of the URL that represents the location of the package.

In the case of the above example, it is --trusted-host object-storage.tyo2.conoha.io.

It was a very simple story, but I'm quite addicted to it, so if you have the same eyes, please try it.

Well then.

Recommended Posts

Solution when pip install from other than the official website and SSL Error (SSL authentication error) occurs
Eliminates SSL error when PIP Install on Windows.
A memorandum when an error occurs with pip install
# Solution when pip install gives an error when using Anaconda on Windows 10
Solution when an error occurs when hiding the console screen with PyInstaller
Proxy error when running "pip install"
I got an error when trying to install Xgboost and its solution
[OSX] [pyenv] What to do when an SSL error occurs in pip
SSL certificate related with pip install? Error
Solution for pip install error [Python] [Mac]
[Arch linux] Solution when package-query error occurs
What to do when SSL error occurs in pip in Windows10, miniconda, VScode environment