pip install出错:Cannot connect to proxy

3 篇文章 0 订阅
3 篇文章 0 订阅

pip install *** :Cannot connect to proxy

在使用pip install 安装任何新的包都会出现下面错误:

PS C:\WINDOWS\system32> pip install django
Looking in indexes: http://pypi.douban.com/simple
Collecting django
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', 
  NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0x000002574165FF60>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',))': 
  http://pypi.douban.com/simple/django/
  
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', 
  NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0x000002574165F128>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',))': 
  http://pypi.douban.com/simple/django/
  
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', 
  NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0x0000025741663208>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',))': 
  http://pypi.douban.com/simple/django/
  
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', 
  NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0x0000025741663358>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',))': 
  http://pypi.douban.com/simple/django/
  
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', 
  NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0x00000257416630F0>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',))': 
  http://pypi.douban.com/simple/django/
  
  Could not find a version that satisfies the requirement django (from versions: )
No matching distribution found for django

出现这样的问题的原因是代理出现了问题,安装了蓝灯出现的。只要关闭蓝灯, pip install 就会提示上面的bug。

解决办法:

按Win+R快捷键,输入regedit,打开注册表编辑器找到HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings分支,把它下面以 Proxy 打头的键值对(如ProxyEnable,ProxyOverride,ProxyServer等)全部删除。

这样再次 pip install 就可以了。

  • 25
    点赞
  • 34
    收藏
    觉得还不错? 一键收藏
  • 17
    评论
评论 17
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值