question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`ResolutionImpossible` error message does not distinguish between extras

See original GitHub issue

Description

If a package has extras with conflicting dependencies, the error message displayed by pip does not clarify which extras triggered the conflict, and also produces an error message with is rather confusing. Example (see steps to reproduce):

The conflict is caused by:
    resolution-impossible-with-extras[extra1,extra2,extra3] 0.0.0 depends on pandas<2 and >=1.3
    resolution-impossible-with-extras[extra1,extra2,extra3] 0.0.0 depends on pandas==1.4.1

This happens when extra1 asks for pandas==1.4.0 and extra2 asks for pandas==1.4.1. extra3 has nothing to do with the conflict, but from the error message it’s impossible to tell. In addition, the error message never mentions neither which extras that caused the issue, nor the actual issue, as pandas==1.4.0 is never mentioned.

Expected behavior

It should point to the extras that triggered the ResolutionImpossible error in a clear way.

pip version

22.0.2

Python version

3.9

OS

Ubuntu 21.10

How to Reproduce

Create a setup.cfg with the following content:

[metadata]
name = resolution_impossible_with_extras

[options]
install_requires =
    pandas >=1.3, <2

[options.extras_require]
extra1 = 
    pandas==1.4.0
extra2 = 
    pandas==1.4.1
extra3 = 
    numpy==1.22.1

and an “empty” setup.py like the following content:

from setuptools import setup
setup()

Then execute in the same folder:

pip install .[extra1,extra2,extra3]

Output

Processing /path/to/folder/resolution-impossible-with-extras/package
  Preparing metadata (setup.py) ... done
Requirement already satisfied: pandas<2,>=1.3 in /path/to/folder/resolution-impossible-with-extras/venv/lib/python3.9/site-packages (from resolution-impossible-with-extras==0.0.0) (1.4.0)
ERROR: Cannot install resolution-impossible-with-extras[extra1,extra2]==0.0.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    resolution-impossible-with-extras[extra1,extra2,extra3] 0.0.0 depends on pandas<2 and >=1.3
    resolution-impossible-with-extras[extra1,extra2,extra3] 0.0.0 depends on pandas==1.4.1

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Code of Conduct

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
q0wcommented, Feb 3, 2022

Run it several times.

0reactions
uranusjrcommented, Apr 16, 2022

If anyone’s interested in improving this, see also #9237.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pipenv on Windows: 'module' object is not callable
I've tried installing requests and flask , with the same results. python: Python 3.6.4 :: Anaconda, Inc. pip: pip 18.0 from c:\users\edgar\ ...
Read more >
Dependency Management with Pip, Python's Package Manager
Try a faster and easier way to manage your Python dependencies. Use Python 3.9 by ActiveState and build your own runtime with the...
Read more >
factory.py - import contextlib import functools import logging from ...
_vendor.resolvelib import ResolutionImpossiblefrom pip. ... Therequirements are guaranteed to not have extras.:param extras: The extras to inject into the ...
Read more >
User Guide - 《pip v20.3.3 documentation》 - 书栈网
Understanding your error message; Possible solutions ... Note that you should not rely on the items in the file being installed by pip...
Read more >
Installation — Airflow Documentation
Differences between extras and providers ... The default Airflow installation doesn't have many integrations and you have to install them yourself.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found