windows下pip install xx 遇到的 ConnectionResetError問題

hearthougan發表於2018-09-08

用pip install 遇到如下的問題


C:\Users\*******>pip install Python 3.X
Collecting Python
  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connec
tion broken by 'ProxyError('Cannot connect to proxy.', ConnectionResetError(1005
4, '遠端主機強迫關閉了一個現有的連線。', None, 10054, None))': /simple/python/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connec
tion broken by 'ProxyError('Cannot connect to proxy.', ConnectionResetError(1005
4, '遠端主機強迫關閉了一個現有的連線。', None, 10054, None))': /simple/python/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connec
tion broken by 'ProxyError('Cannot connect to proxy.', ConnectionResetError(1005
4, '遠端主機強迫關閉了一個現有的連線。', None, 10054, None))': /simple/python/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connec
tion broken by 'ProxyError('Cannot connect to proxy.', ConnectionResetError(1005
4, '遠端主機強迫關閉了一個現有的連線。', None, 10054, None))': /simple/python/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connec
tion broken by 'ProxyError('Cannot connect to proxy.', ConnectionResetError(1005
4, '遠端主機強迫關閉了一個現有的連線。', None, 10054, None))': /simple/python/
  Could not find a version that satisfies the requirement Python (from versions:
 )
No matching distribution found for Python

首先你可以修改一下pip 源

1、在下圖,輸入 :%APPDATA%

或者這裡

2、新建pip檔案,在pip資料夾中建pip.ini,輸入:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple

如果解決不了,還是要設定CMD命令列下的代理伺服器。按照下圖方式:

1.我的電腦->屬性->高階->環境變數->系統變數。

2.新建引數名為:HTTP_proxy。

3.路徑名為:http://yourproxy.com:yourport/

 

相關文章