解決pip?install報錯:Cannot?connect?to?proxy問題
pip install *** :Cannot connect to proxy
在使用pip install 安裝任何新的包都會出現(xiàn)下面錯誤:
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
出現(xiàn)這樣的問題的原因是代理出現(xiàn)了問題,安裝了藍燈出現(xiàn)的。只要關閉藍燈, 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("''",))
如果是初次使用代理,以上三種錯誤出現(xiàn)的原因基本是1.端口錯誤2.代理類型不正確。
明確的一點是訪問https站點,要用https類型的代理。http同理。
如圖
西刺代理分的比較明確
第一次用的時候就是因為這個浪費我半天時間。。
總結
以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關文章
pip 錯誤unused-command-line-argument-hard-error-in-future解決辦法
這篇文章主要介紹了Python包管理器pip安裝軟件時出現(xiàn)unused-command-line-argument-hard-error-in-future錯誤的解決辦法,需要的朋友可以參考下2014-06-06Python字典一個key對應多個value幾種實現(xiàn)方式
python中字典的健和值是一一對應的,如果對字典進行添加操作時如果健的名字相同,則當前健對應的值就會被覆蓋,有時候我們想要一個健對應多個值的場景,這篇文章主要給大家介紹了關于Python字典一個key對應多個value幾種實現(xiàn)方式的相關資料,需要的朋友可以參考下2023-10-10Pandas如何將表格的前幾行生成html實戰(zhàn)案例
這篇文章主要介紹了Pandas如何將表格的前幾行生成html實戰(zhàn)案例,文章圍繞主題展開詳細的內(nèi)容介紹,具有一定的參考價值,需要的小伙伴可以參考一下2022-08-08把Anaconda中的環(huán)境導入到Pycharm里面的方法步驟
這篇文章主要介紹了把Anaconda中的環(huán)境導入到Pycharm里面的方法步驟,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2020-10-10python實現(xiàn)顏色空間轉(zhuǎn)換程序(Tkinter)
這篇文章主要介紹了基于Tkinter利用python實現(xiàn)顏色空間轉(zhuǎn)換程序,感興趣的小伙伴們可以參考一下2015-12-12