安装pip时出现超时错误

2024-05-23 23:14:46 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图将pip下载到我的计算机上,结果出现超时错误。(我正在跟踪此链接:https://pip.pypa.io/en/latest/installing.html#install-pip) 有人知道该怎么做吗?

这就是我所说的:

C:\Users\gshelef\Desktop>python get-pip.py

错误:

Collecting pip Retrying (Retry(total=4, connect=None, read=None,
redirect=None)) after connection broken by
'ConnectTimeoutError( object at 0x0000000003E3EF28>, 'Connection to pypi.python.org
timed out. (connect timeout=15)')': /simple/pip/`

注意,我有3.3.2 Python版本


Tags: installpiphttpsionone链接html计算机
2条回答

由于代理,pip安装时发生连接超时错误。要解决此问题,需要使用以下命令设置代理设置: 设置HTTP_PROXY=http://user:password@proxy.domain.com:port

有关代理的详细信息,请在此处查找代理设置:http://www.whatismyproxy.com/ 和 设置HTTP_PROXY=http://proxy:8080

不过,pip是与python一起预装的。您可以在以下位置找到它: C: \Users\gshelef\AppData\Local\Programs\Python\Python\Scripts。

您需要将上述路径添加到环境变量才能使用它。

在本地目录中准备pip、setuptools和wheel(例如/),您就可以在没有internet的情况下安装pip。 python get-pip.py--无索引--查找链接=。/

引用:https://github.com/pypa/pip/issues/2351

相关问题 更多 >