解决python安装pip install mock报Could not fetch URL https://pypi.org/simple/mock/: There was a problem confirmin g the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443)的问题
问题:使用python2安装mock包,报
Could not fetch URL https://pypi.org/simple/mock/: There was a problem confirmin
g the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retri
es exceeded with url: /simple/mock/ (Caused by SSLError(SSLError(1, u'[SSL: CERT
IFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'),)) - skipping
ERROR: Could not find a version that satisfies the requirement mock (from versio
ns: none)
ERROR: No matching distribution found for mock
执行pip2 --trusted-host pypi.python.org install mock扔报同样的错误
在网上查阅,解决方法如下:
1、下载最新的pip工具包, pip工具下载的地址: https://pypi.org/project/pip/9.0.1/#files
2、解压后,执行setup.py文件 前提是先去把python2的环境下面的python.exe改为python2.exe文件
然后再cmd下面输入:python2 setup.py isntall
出现下面的截图说明pip可以正常使用了!
3、这时候就可以使用pip2 这个命令安装任何包了。
参考https://www.cnblogs.com/fighter007/p/9417976.html