Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

ResolutionTooDeep: 100 with all pinned dependencies, even when they are already satisfied #20

Closed
astrojuanlu opened this issue Apr 21, 2020 · 3 comments

Comments

@astrojuanlu
Copy link

I was testing --unstable-feature=resolver in the new pip 20.1b1 (thanks ❤️) and found pip._vendor.resolvelib.resolvers.ResolutionTooDeep: 100 in the middle of the collection step. The requirements.txt file is 164 lines long, but all the versions are pinned (it's an output of pip-tools) so I guess the solver shouldn't do any real work.

In fact, testing in an environment that already has all those dependencies, pip correctly checks that they are all already satisfied and right after checking the last one, it fails:

$ tail requirements.txt 
traittypes==0.2.1         # via ipyleaflet
urllib3==1.25.7           # via requests
vine==1.2.0               # via -r requirements.in, amqp
wcwidth==0.1.8            # via prompt-toolkit
webencodings==0.5.1       # via bleach
widgetsnbextension==3.5.1  # via ipywidgets
xarray==0.14.1            # via ipyleaflet

# The following packages are considered to be unsafe in a requirements file:
# setuptools
$ pip install --no-cache-dir -r requirements.txt --no-cache --unstable-feature=resolver
[...]
Requirement already satisfied: urllib3==1.25.7 in /home/juanlu/.pyenv/versions/3.8.2/envs/bw38/lib/python3.8/site-packages (from -r requirements.txt (line 156)) (1.25.7)
Requirement already satisfied: vine==1.2.0 in /home/juanlu/.pyenv/versions/3.8.2/envs/bw38/lib/python3.8/site-packages (from -r requirements.txt (line 157)) (1.2.0)
Requirement already satisfied: wcwidth==0.1.8 in /home/juanlu/.pyenv/versions/3.8.2/envs/bw38/lib/python3.8/site-packages (from -r requirements.txt (line 158)) (0.1.8)
Requirement already satisfied: webencodings==0.5.1 in /home/juanlu/.pyenv/versions/3.8.2/envs/bw38/lib/python3.8/site-packages (from -r requirements.txt (line 159)) (0.5.1)
Requirement already satisfied: widgetsnbextension==3.5.1 in /home/juanlu/.pyenv/versions/3.8.2/envs/bw38/lib/python3.8/site-packages (from -r requirements.txt (line 160)) (3.5.1)
Requirement already satisfied: xarray==0.14.1 in /home/juanlu/.pyenv/versions/3.8.2/envs/bw38/lib/python3.8/site-packages (from -r requirements.txt (line 161)) (0.14.1)
Requirement already satisfied: setuptools==46.1.3 in /home/juanlu/.pyenv/versions/3.8.2/envs/bw38/lib/python3.8/site-packages (from ipython==7.11.1->-r requirements.txt (line 79)) (46.1.3)
ERROR: Exception:
Traceback (most recent call last):
  File "/home/juanlu/.pyenv/versions/bw38/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 188, in _main
    status = self.run(options, args)
  File "/home/juanlu/.pyenv/versions/bw38/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 185, in wrapper
    return func(self, options, args)
  File "/home/juanlu/.pyenv/versions/bw38/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 332, in run
    requirement_set = resolver.resolve(
  File "/home/juanlu/.pyenv/versions/bw38/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 80, in resolve
    self._result = resolver.resolve(requirements)
  File "/home/juanlu/.pyenv/versions/bw38/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 413, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/home/juanlu/.pyenv/versions/bw38/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 323, in resolve
    raise ResolutionTooDeep(max_rounds)
pip._vendor.resolvelib.resolvers.ResolutionTooDeep: 100

I am working on a reproducer I can disclose safely.

@pradyunsg
Copy link
Owner

@astrojuanlu Thanks for testing the alpha and filing this issue. It'd be great if you could share the reproducer for this.

@pfmoore Here's what the ResolutionTooDeep exception looks like. :)

@pradyunsg
Copy link
Owner

@astrojuanlu Could you try out pip's current master branch (installable via pip install https://github.com/pypa/pip/archive/master.zip)?

It contains pypa/pip#8275, which should result in this error not being raised in any sane configuration / set of packages. :)

@astrojuanlu
Copy link
Author

Sorry I could not give a reproducer, I tried removing dependencies here and there and still could not see exactly where the problem was. Still, installing pip from master worked beautifully, the problem is gone, and the dependencies are all installed :) From my side, this issue can be closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants