(ptoe) D:\MyFile\arc\pyenv\ptoe>pip install pprint
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/pprint/
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:1108)'))': /simple/pprint/
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:1108)'))': /simple/pprint/
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:1108)'))': /simple/pprint/
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:1108)'))': /simple/pprint/
Could not fetch URL https://pypi.org/simple/pprint/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pprint/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)'))) - skipping
ERROR: Could not find a version that satisfies the requirement pprint (from versions: none)
ERROR: No matching distribution found for pprint
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:1108)'))) - skipping
There is an error in SSL authentication. I can't trust the connection destination, but I don't know what the cause is. It's a company PC, so it's scary to mess with network settings too much.
After googled, it seems OK if the connection destination is trusted with the pip option. (I'm worried that there are only MAC examples and few Windows examples.)
Use the "--trusted-host" option to authenticate the connected site only during installation. The following three are required. If it is not enough, the same error as above will occur.
--trusted-host pypi.python.org
--trusted-host files.pythonhosted.org
--trusted-host pypi.org
(ptoe) D:\MyFile\arc\pyenv\ptoe>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/36/74/38c2410d688ac7b48afa07d413674afc1f903c1c1f854de51dc8eb2367a5/pip-20.2-py2.py3-none-any.whl (1.5MB)
|████████████████████████████████| 1.5MB 3.3MB/s
Installing collected packages: pip
Found existing installation: pip 19.2.3
Uninstalling pip-19.2.3:
Successfully uninstalled pip-19.2.3
Successfully installed pip-20.2
The PIP upgrade has passed! !! (* ´ω ` *)
(ptoe) D:\MyFile\arc\pyenv\ptoe>python -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org pip pprint
Requirement already satisfied: pip in ![Comment 2020-08-04 155203.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/600163/6dea129d-3250-af0c-fff9-bb139a38391f.png)
d:\myfile\arc\pyenv\ptoe\lib\site-packages (20.2)
Collecting pprint
Downloading pprint-0.1.tar.gz (860 bytes)
Using legacy 'setup.py install' for pprint, since package 'wheel' is not installed.
Installing collected packages: pprint
Running setup.py install for pprint ... done
Successfully installed pprint-0.1
The library was installed successfully.
It's a little bit to write and install 3 "--trusted-host" every time ... In that case, if you create and write pip.ini, you do not need to specify the --trusted-host option after that.
[global]
trusted-host = pypi.python.org
pypi.org
files.pythonhosted.org
I didn't know where to put pip.ini on Windows, It was written in the official pip documentation.
#For user local
%APPDATA%\pip\pip.ini
#Global
C:\ProgramData\pip\pip.ini
#Virtual environment(venv)in the case of
%VIRTUAL_ENV%\pip.ini
Virtual environment storage image
https://github.com/pypa/pip/issues/5448 https://pip.pypa.io/en/stable/user_guide/#configuration
Recommended Posts