pip: New Resolver Error Reporting (case: ward==0.44.1b0 and py2neo==4.3.0)

Packages ward and py2neo (as reported via the pip research survey)

Resolver will go all the way down to ward 0.28.0b0 (current version is 0.45.0b0) to resolve dependency conflicts.

With pinned versions, here is the output:

(pip-exp) [nlh@navi personal]$ pip --version
pip 20.1 from /home/nlh/.virtualenvs/pip-exp/lib/python3.7/site-packages/pip (python 3.7)
(pip-exp) [nlh@navi personal]$ pip install ward==0.44.1b0 py2neo==4.3.0 --unstable-feature=resolver
Collecting https://files.pythonhosted.org/packages/af/41/c2d52a226b560618fe3df213a15e3f1ea3da09b8520a439756b619f3157d/py2neo-4.3.0.tar.gz#sha256=a218ccb4b636e3850faa6b74ebad80f00600217172a57f745cf223d38a219222
  Using cached py2neo-4.3.0.tar.gz (71 kB)
Collecting https://files.pythonhosted.org/packages/0b/7e/ca368a8d8e288be1352d4e2df35da1e01f8aaffbf526695df71630bcb8a6/neotime-1.7.4.tar.gz#sha256=4e0477ba0f24e004de2fa79a3236de2bd941f20de0b5db8d976c52a86d7363eb (from py2neo==4.3.0)
  Using cached neotime-1.7.4.tar.gz (17 kB)
Collecting ward==0.44.1b0
  Using cached ward-0.44.1b0-py3-none-any.whl (28 kB)
Collecting https://files.pythonhosted.org/packages/5b/7c/7bc4b5d74fdf890dadf1ca1057e4ce83d2ae51e89e69aa603310d63c9b07/ward-0.44.1b0.tar.gz#sha256=074fca910d0be929f753575b4657d0b94e0e3da45902bce0e96f9db5ca1d16fb
  Using cached ward-0.44.1b0.tar.gz (27 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
ERROR: Could not find a version that satisfies the requirement pygments~=2.3.1 (from py2neo)
ERROR: Could not find a version that satisfies the requirement pygments<3.0.0,>=2.4.2 (from ward)
ERROR: Could not find a version that satisfies the requirement pygments~=2.3.1 (from py2neo)
ERROR: Could not find a version that satisfies the requirement pygments<3.0.0,>=2.4.2 (from ward)
ERROR: No matching distribution found for pygments, pygments, pygments, pygments

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (18 by maintainers)

Most upvoted comments

I think that would be very helpful!

It basically seems like a duplicate of #8377, so yes, let’s close this and focus on that one

ok @uranusjr @pfmoore would it be helpful if me and @ei8fdb provided you with a dict containing each of the specifiers listed in pep 440?

Maybe the way forward here is to cover the most common use cases, and just not output any human readable content for cases that are too complex?

Ok, could we do this using a dict? e.g.

human_readable_operators= {
    "<": "less than",
    "<=": "less than or equal to",
    ...
}

Minor point: ~= is Compatible version. It’s relevant here because there’s context that we have to assume the user understands, about how versions are specified.

So to be 100% explicit, you are proposing that the user should see the following:

>pip install ward==0.44.1b0 py2neo==4.3.0 --unstable-feature=resolver
Collecting ward==0.44.1b0
  Downloading ward-0.44.1b0-py3-none-any.whl (28 kB)
Collecting py2neo==4.3.0
  Downloading py2neo-4.3.0.tar.gz (71 kB)
     |████████████████████████████████| 71 kB 4.8 MB/s
ERROR: Cannot install ward v0.44.1b0 and py2neo v4.3.0 because these package versions have conflicting dependencies.
The conflict is caused by:
    ward 0.44.1b0 depends on pygments <3.0.0,>=2.4.2 (lower than 3.0.0 but greater or equal to 2.4.2)
    py2neo 4.3.0 depends on pygments ~=2.3.1 (approximately equal to version 2.3.1)

There are a number of possible solutions. You can try:
    removing package versions from your requirements, and letting pip try to resolve the problem for you
    trying a version of ward that depends on pygments v2.3.1. Try pip-search ward --dep pygments~=2.3.1
    replacing ward or py2neo with a different package altogether
    patching py2neo to use pygments <3.0.0,>=2.4.2
    force installing (Be aware!)

For instructions on how to do these steps visit: https://pypa.io/SomeLink"
To debug this further you can run pip-tree to see all of your dependencies.

That seems… rather verbose? It also has a number of practical issues in the “possible solutions” section.

  • How do we determine (from the information pip has) that the advice is reasonable? Or is this all just boilerplate that would be produced for every such error?
  • The pip-search tool mentioned doesn’t exist (as far as I can see). We should stick to things that are actually available 🙂 I get that this is an example, but at some point we need to pin down the precise text, so I’m suggesting we do that now. Same for the link to the docs. And pip-tree.
  • Who is the “patching py2neo” advice aimed at? Most users would likely only be able to go as far as “file a bug report against py2neo and wait”…

In terms of implementability, the following issues need to be considered:

  1. The exact text to use, as noted above.
  2. There’s no library or code we can use to convert a spec into “human readable” form. I’d suggest that adding human-readable versions be a possible future improvement, rather than something we need right now.
  3. We need to define what precisely would trigger this particular error - at the moment we do exactly the same for every occurrence of ResolutionImpossible, so if we want to be more specific, we need to understand what message applies in which case. I’d suggest that by default we have one message for all occurrences, and see if that works.