问题:使用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

解决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)的问题

 

 

 执行pip2 --trusted-host pypi.python.org install mock扔报同样的错误

 

在网上查阅,解决方法如下:

1、下载最新的pip工具包, pip工具下载的地址:  https://pypi.org/project/pip/9.0.1/#files

解决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)的问题

2、解压后,执行setup.py文件 前提是先去把python2的环境下面的python.exe改为python2.exe文件

 解决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)的问题

然后再cmd下面输入:python2 setup.py isntall 

 解决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)的问题

 出现下面的截图说明pip可以正常使用了!

解决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)的问题

3、这时候就可以使用pip2 这个命令安装任何包了。

 解决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)的问题

 

 

参考https://www.cnblogs.com/fighter007/p/9417976.html

 

 

 

相关文章:

  • 2021-05-01
  • 2022-12-23
  • 2021-12-17
  • 2021-11-12
  • 2021-09-15
  • 2022-01-04
  • 2022-12-23
  • 2021-07-04
猜你喜欢
  • 2022-12-23
  • 2021-10-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案