pip升级TooManyRedirects异常

我正在尝试pip install --upgrade pip在Docker容器内,但出现错误:

Exception:

Traceback (most recent call last):

File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 209, in main

status = self.run(options, args)

File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 328, in run

wb.build(autobuilding=True)

File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 748, in build

self.requirement_set.prepare_files(self.finder)

File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 360, in prepare_files

ignore_dependencies=self.ignore_dependencies))

File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 577, in _prepare_file

session=self.session, hashes=hashes)

File "/usr/lib/python2.7/dist-packages/pip/download.py", line 810, in unpack_url

hashes=hashes

File "/usr/lib/python2.7/dist-packages/pip/download.py", line 649, in unpack_http_url

hashes)

File "/usr/lib/python2.7/dist-packages/pip/download.py", line 842, in _download_http_url

stream=True,

File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 480, in get

return self.request('GET', url, **kwargs)

File "/usr/lib/python2.7/dist-packages/pip/download.py", line 378, in request

return super(PipSession, self).request(method, url, *args, **kwargs)

File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 468, in request

resp = self.send(prep, **send_kwargs)

File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 597, in send

history = [resp for resp in gen] if allow_redirects else []

File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 113, in resolve_redirects

raise TooManyRedirects('Exceeded %s redirects.' % self.max_redirects)

TooManyRedirects: Exceeded 30 redirects.

有谁知道这是什么原因,和/或如何解决?

回答:

服务器将重定向发送到pip客户端。假设您使用的是默认PyPI而不是代理,那么首先要检查的是status.python.org上的Python状态页。

这是最近发布的:

更新-我们目前正在调查某些软件包安装的重定向循环。

世界标准时间4月16日15:22

这甚至是最近:

更新-我们针对新的PyPI在files.pythonhosted.org上针对重定向问题推出了修复程序,并且正在监视。

世界标准时间4月16日15:35

以上是 pip升级TooManyRedirects异常 的全部内容, 来源链接: utcz.com/qa/420806.html

回到顶部