与 pypi.org 的连接超时

问题描述 投票:0回答:4

无法 pip 安装第 3 方软件包。

(venv) λ pip install django
Collecting django
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001BEF10AD0F0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/django/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001BEF10ADE48>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/django/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001BEF10BB518>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/django/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001BEF10BB320>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/django/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001BEF10BB7B8>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/django/
  Could not find a version that satisfies the requirement django (from versions: )
No matching distribution found for django

我正在尝试通过输入

pip install django
来进行 pip 安装。为了提供上下文,我正在使用 Windows 10 在自己的个人计算机上工作。我读过的所有其他资源似乎都可以解决该问题。我正在尝试找出可以做什么,这样我就可以简单地...

pip install django

我不熟悉代理和防火墙,我不清楚需要采取哪些措施。

python pip
4个回答
4
投票

您似乎正在网络中使用代理。您需要指定代理详细信息才能通过它,或者停止代理一段时间。

我认为你的问题与另一个问题类似:

使用 pip 进行代理感知


1
投票

这是网络问题。您的电脑似乎无法连接互联网。由于这是个人电脑,因此您可能不使用代理。检查 PC 上的互联网连接或 Windows 防火墙。


1
投票

我也遇到过同样的问题。 基本上是HTTP连接有问题。 检查环境变量Path中是否设置了Proxy。 如果存在,请将其删除。然后安装就可以了。


0
投票

“我不熟悉代理和防火墙,我不清楚它们是什么 需要采取陡峭的措施。”

可能由于 VPN 保护对某些域的访问而无法连接到 pypi.org。尝试关闭或打开您的 VPN

© www.soinside.com 2019 - 2024. All rights reserved.