Poetry gives: `TooManyIndirects` error suddenly

Viewed 1391

I have a pyproject.toml:

...
[[tool.poetry.source]]

name = "REPO_NAME"
url = "https://gitlab.com/SOME_ADDRESS"
secondary = true

When trying to install the project using poetry (poetry install/poetry update) i get:

Updating dependencies Resolving dependencies... (14.3s)

TooManyRedirects

Exceeded 30 redirects.

3 Answers

Currently pypi.python.org is having an issue and there is nothing one can do about it:

enter image description here

But hey, it's Friday.

Clearing the cache seemed to do the trick:

poetry cache clear --all REPO_NAME

Also, it could happen on global PYPI, in that case run:

poetry cache clear --all pypi

To list all poetry's repos:

poetry cache list

There has been an issue with PyPI Json endpoints that poetry uses. pip was unaffected because it uses different endpoints.

A workaround is to export poetry dependencies to the requirements.txt format and use pip:

poetry export --dev > requirements.txt && pip install -r requirements.txt
Related