解决pip install报错:Cannot connect to proxy问题

作者:Rubick_Y 时间:2021-05-01 01:14:11 

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 就可以了。

python requests proxies 错误

ProxyError: HTTPSConnectionPool(host='www.zhihu.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x03CEFB50>: Failed to establish a new connection: [Errno 10060] ',)))

SSLError: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:590)

ConnectionError: ('Connection aborted.', BadStatusLine("''",))

如果是初次使用代理,以上三种错误出现的原因基本是1.端口错误2.代理类型不正确。

明确的一点是访问https站点,要用https类型的代理。http同理。

如图

西刺代理分的比较明确

解决pip install报错:Cannot connect to proxy问题

第一次用的时候就是因为这个浪费我半天时间。。

来源:https://blog.csdn.net/gdsfga/article/details/83040291

标签:pip,install,Cannot,connect,proxy
0
投稿

猜你喜欢

  • Python中常用的os操作汇总

    2022-12-13 08:30:16
  • Python 中pandas索引切片读取数据缺失数据处理问题

    2021-06-02 05:13:28
  • SQLServer与服务器连接时出错的解决方案

    2009-06-28 14:35:00
  • 十个简单好用的设计技巧[译]

    2009-04-08 12:56:00
  • python爬虫 基于requests模块发起ajax的get请求实现解析

    2022-01-02 05:04:04
  • python提取内容关键词的方法

    2021-07-29 00:45:37
  • 详谈套接字中SO_REUSEPORT和SO_REUSEADDR的区别

    2023-06-07 14:24:23
  • 匿名函数的写法

    2010-01-06 13:32:00
  • Python SQLite3简介

    2023-05-29 11:26:01
  • Ajax学习小贴士

    2007-10-24 23:21:00
  • Python Request类源码实现方法及原理解析

    2021-03-23 02:23:50
  • cmd运行python文件时对结果进行保存的方法

    2023-03-12 03:18:02
  • Python中的元组介绍

    2021-04-09 19:56:37
  • PyQt 如何创建自定义QWidget

    2023-09-13 17:30:48
  • python实现微信防撤回神器

    2022-03-14 14:22:04
  • pyspark创建DataFrame的几种方法

    2023-01-09 01:30:53
  • asp.net性能的技巧

    2007-10-07 21:55:00
  • Python学习之日志模块详解

    2022-06-24 09:20:22
  • 验证码-挑战你的智慧

    2008-09-10 13:08:00
  • python脚本爬取字体文件的实现方法

    2022-09-07 18:20:55
  • asp之家 网络编程 m.aspxhome.com