Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install --unstable-feature=resolver fails with "ResolutionTooDeep: 100" #8204

Closed
youtux opened this issue May 7, 2020 · 17 comments
Closed

Comments

@youtux
Copy link

youtux commented May 7, 2020

Environment

  • pip version: 20.1
  • Python version: 2.7.17
  • OS: MacOS 10.15.4

Description
I have a project with a very long list of dependencies, and the experimental resolver fails with the ResolutionTooDeep exception.

Expected behavior
It should be able to handle my long list of dependencies (pip freeze | wc counts 223 packagess installed).

How to Reproduce

pip install --unstable-feature=resolver -r requirements.txt

Where requirements.txt contains a lot of dependencies.

Output

[...]
ERROR: Exception:
Traceback (most recent call last):
  File "/Users/youtux/paylogic/paylogic/env/lib/python2.7/site-packages/pip/_internal/cli/base_command.py", line 188, in _main
    status = self.run(options, args)
  File "/Users/youtux/paylogic/paylogic/env/lib/python2.7/site-packages/pip/_internal/cli/req_command.py", line 185, in wrapper
    return func(self, options, args)
  File "/Users/youtux/paylogic/paylogic/env/lib/python2.7/site-packages/pip/_internal/commands/install.py", line 333, in run
    reqs, check_supported_wheels=not options.target_dir
  File "/Users/youtux/paylogic/paylogic/env/lib/python2.7/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 80, in resolve
    self._result = resolver.resolve(requirements)
  File "/Users/youtux/paylogic/paylogic/env/lib/python2.7/site-packages/pip/_vendor/resolvelib/resolvers.py", line 413, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/Users/youtux/paylogic/paylogic/env/lib/python2.7/site-packages/pip/_vendor/resolvelib/resolvers.py", line 323, in resolve
    raise ResolutionTooDeep(max_rounds)
ResolutionTooDeep: 100
@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label May 7, 2020
@uranusjr
Copy link
Member

uranusjr commented May 7, 2020

Would you be able to provide the list of packages? This error essentially means the resolver tried too many combinations and judge it should give up, and a very long list of requirements would be a possible reason to that.

@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label May 7, 2020
@pradyunsg
Copy link
Member

Thanks for trying out the alpha resolver @youtux! ^>^

If you can provide the requirements.txt file, that's be ideal. It would enable us to diagnose why this error is happening, if the new resolver's behavior is indeed correct and if we can present a better error message in this instance.

@youtux
Copy link
Author

youtux commented May 8, 2020

This is an example of requirements.txt that results in that error:

alembic
alembic-offline
atomicwrites
attrs
Babel
bcrypt
bidict
billiard
boto3
cairocffi
celery
certifi
cffi
cryptography
defusedxml
Django
dogpile-filesystem
dogpile.cache
enum34
factory-boy
Faker
Flask
Flask-Admin
Flask-Babel
Flask-Cors
Flask-WTF
furl
futures
glob2
greenlet
gunicorn
halogen
html5lib
httplib2
idna
ipaddress
ipython
ipython-genutils
iso8601
isodate
isort
itsdangerous
Jinja2
kombu
lxml
Mako
Markdown
MarkupPy
MarkupSafe
marshmallow
marshmallow-enum
mock
more-itertools
msgpack-python
oauth2client
odfpy
openpyxl
passlib
pathlib2
Pillow
pipdeptree
pluggy
pretenders
Pygments
PyJWT
PyMySQL
PyNaCl
pyOpenSSL
pyparsing
Pyphen
pyquery
pyrepl
pytest
pytest-bdd
pytest-factoryboy
pytest-forked
pytest-instafail
pytest-repeat
pytest-services
pytest-timeout
pytest-xdist
python-dateutil
pytz
PyYAML
raven
redis
reportlab
requests
selenium
simplejson
six
splinter
SQLAlchemy
SQLAlchemy-Utc
SQLAlchemy-Utils
subprocess32
webargs
webcolors
Werkzeug
WTForms
xlrd
xlwt
zc.lockfile
zeep

@pradyunsg
Copy link
Member

Awesome! The --log file for this (pip install --unstable-feature=resolver -r requirements.txt --log log.txt) is... 21000+ lines. I've put it up here.

That's gonna take a bit of time to grok through.

@pradyunsg
Copy link
Member

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

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

/cc @rouge8 as well!

@rouge8
Copy link
Contributor

rouge8 commented May 20, 2020

Tested 9999f0e on a few large projects (~150 dependencies each) and everything installed without errors! 🎉

@pfmoore
Copy link
Member

pfmoore commented May 20, 2020

@rouge8 Thanks for checking! What was the performance like? We'd set a low value from concern that big resolves might take too long. I assume from the fact that you didn't say anything that there wasn't a problem there?

@rouge8
Copy link
Contributor

rouge8 commented May 20, 2020

Re-ran with timing on a project with 138 dependencies:

  • Legacy resolver:

    real	2m35.274s
    user	0m43.656s
    sys	0m28.398s
    
  • New resolver:

    real	3m32.982s
    user	1m32.455s
    sys	0m43.059s
    

@timmc-edx
Copy link

Similarly, you can also try pip install --unstable-feature=resolver -r requirements/edx/development.txt in https://github.com/edx/edx-platform/ inside a Python 3.5 environment. This requirements file is created by pip-tools so it's almost entirely explicit version pins, along with a handful of git+https and relative path dependencies, for a total of 326 packages. Crashes with ResolutionTooDeep (but have not tried with fix #8275).

New resolver is a lot slower but I think this is just due to the git clone operations.

@pfmoore
Copy link
Member

pfmoore commented May 20, 2020

Many thanks, that's useful information.

@timmc-edx
Copy link

I retested with pip 20.2b1 and this is fixed for edx-platform. 🎉

@ei8fdb
Copy link
Contributor

ei8fdb commented Jun 1, 2020

Hi @youtux @timmc-edx

Did you see our UX team call to test the resolver? If so, where did you see it? If not how did you decide to test the new resolver?

Would you be willing to take part in a short interview? We're currently writing new resolver error messages and need to test them with people to see if they provide the right information, explain why the error has occurred.

Would you be willing to speak with us? Thanks!

@youtux
Copy link
Author

youtux commented Jun 3, 2020

I tested again with the master branch of pip, and indeed I don't get the error anymore.
The new resolver found some incompatible dependencies that were there for quite some time in a project, which is great! Not even pip check could spot that problem.

@ei8fdb I was following this issue for quite some time, that's where I saw that the new feature was available.

I am up for the interview!

@ei8fdb
Copy link
Contributor

ei8fdb commented Jun 11, 2020

@youtux Great. If you've got some time in the coming weeks, I'd like to speak with you. What's the best way to get in touch?

@youtux
Copy link
Author

youtux commented Jun 11, 2020

sure thing! You can DM me on twitter: https://twitter.com/youtux

@uranusjr
Copy link
Member

uranusjr commented Aug 4, 2020

Should we close this issue, or are there remaining action items here?

@youtux
Copy link
Author

youtux commented Aug 4, 2020

Yep!

@youtux youtux closed this as completed Aug 4, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants