pip 升级 TooManyRedirects 异常 [英] pip upgrade TooManyRedirects exception

查看:32
本文介绍了pip 升级 TooManyRedirects 异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 docker 容器内 pip install --upgrade pip,但是,我收到错误:

I'm trying to pip install --upgrade pip inside a docker container, however, I get the error:

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.

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

Does anyone know what the cause of this is, and/or how to solve it?

推荐答案

服务器向 pip 客户端发出重定向.假设您使用的是默认 PyPI 而不是代理,首先要检查的是 status.python 上的 Python 状态页面.组织.

A redirect is issued by the server to the pip client. Assuming you're using the default PyPI and not a proxy, the first place to check is the Python status page at status.python.org.

这是最近发布的:

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

Update - We are currently investigating redirect loops for some package installs.

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

Apr 16, 15:22 UTC

这是最近的:

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

Update - We've rolled out a fix for the redirect issue on files.pythonhosted.org for the new PyPI and are monitoring.

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

Apr 16, 15:35 UTC

这篇关于pip 升级 TooManyRedirects 异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆