【发布时间】:2018-12-01 23:07:21
【问题描述】:
通过 pip 安装任何东西时,我收到此错误, 无法建立新连接:[WinError 10061] 由于目标机器主动拒绝,无法建立连接。 我正在通过 pip 命令安装 django,即 pip install 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.VerifiedHTTPSConnection
object at 0x04135910>: Failed to establish a new connection: [WinError 10061]
No connection could be made because the target machine actively refused
it',))': /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.VerifiedHTTPSConnection
object at 0x04135850>: Failed to establish a new connection: [WinError 10061]
No connection could be made because the target machine actively refused
it',))': /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.VerifiedHTTPSConnection
object at 0x04135930>: Failed to establish a new connection: [WinError 10061]
No connection could be made because the target machine actively refused
it',))': /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.VerifiedHTTPSConnection
object at 0x04135770>: Failed to establish a new connection: [WinError 10061]
No connection could be made because the target machine actively refused
it',))': /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.VerifiedHTTPSConnection
object at 0x04135870>: Failed to establish a new connection: [WinError 10061]
No connection could be made because the target machine actively refused
it',))': /simple/django/
Could not find a version that satisfies the requirement django (from
versions: )
No matching distribution found for django
【问题讨论】:
-
对我来说似乎是防火墙问题。如果这是问题,请尝试这样做。 pip install pygame‑1.9.3‑cp36‑cp36m‑win_amd64.whl .
-
我使用了这个命令 pip install pygame‑1.9.3‑cp36‑cp36m‑win_amd64.whl ,得到这个错误 - 要求'pygame‑1.9.3‑cp36‑cp36m‑win_amd64.whl'看起来像文件名,但该文件不存在 pygame‑1.9.3‑cp36‑cp36m‑win_amd64.whl 不是有效的轮子文件名。
-
尝试 pip install --upgrade pip 然后运行命令
-
另外,以防万一,将文件重命名为简单的名称,如 abc.whl,然后使用更新的名称运行命令,这样您就可以确定文件名没有出错。
标签: python django httpurlconnection