Environment
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
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.
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.
This is an example of requirements.txt that results in that error:
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
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.
@youtux Could you try out pip's current master branch (installable via pip install https://github.com/pypa/pip/archive/master.zip
)?
It contains https://github.com/pypa/pip/pull/8275, which should result in this error not being raised in any sane configuration / set of packages. :)
/cc @rouge8 as well!
Tested 9999f0ec098f9dc4687eecd118f52a3233e64e8c on a few large projects (~150 dependencies each) and everything installed without errors! 馃帀
@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?
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
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 https://github.com/pypa/pip/pull/8275).
New resolver is a lot slower but I think this is just due to the git clone
operations.
Many thanks, that's useful information.
I retested with pip 20.2b1 and this is fixed for edx-platform. :tada:
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!
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!
@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?
sure thing! You can DM me on twitter: https://twitter.com/youtux
Should we close this issue, or are there remaining action items here?
Yep!