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

Show dependency tree in ResolutionImpossible error message #9036

Open
nlhkabu opened this issue Oct 22, 2020 · 1 comment
Open

Show dependency tree in ResolutionImpossible error message #9036

nlhkabu opened this issue Oct 22, 2020 · 1 comment
Labels
C: dependency resolution About choosing which dependencies to install C: error messages Improving error messages

Comments

@nlhkabu
Copy link
Member

nlhkabu commented Oct 22, 2020

When a user experiences a ResolutionImpossible error, it would be great to be able to display the dependency tree in the error message - e.g.

Both packages top level:

ERROR: Cannot install package_1 and package_2 because these package versions have conflicting dependencies.

The conflict is caused by:
    package_1 requires six<1.9
    package_2 requires six<2 and >=1.9.0

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

ERROR: ResolutionImpossible For help visit: https://pip.pypa.io/en/stable/user_guide/#dependency-conflicts-resolution-impossible

At least one package top level, at least one package deeper in dep tree:

ERROR: Cannot install package_1 and package_2 because these package versions have conflicting dependencies.

The conflict is caused by:
    package_1 requires six<1.9
    package_2 requires six<2 and >=1.9.0

Dependency tree:
- package_1 requires six<1.9
- package_4 requires package_3
  - package_3 requires package_2
    - package_2 requires six<2 and >=1.9.0

To fix this you could try to:
- loosen the range of package versions you've specified
- remove package versions to allow pip to attempt to solve the dependency conflict
- ask the package maintainers to loosen their dependencies

ERROR: ResolutionImpossible For help visit: https://pip.pypa.io/en/stable/user_guide/#dependency-conflicts-resolution-impossible

Both packages deep in dep tree:

ERROR: Cannot install package_1 and package_2 because these package versions have conflicting dependencies.

The conflict is caused by:
    package_1 requires six<1.9
    package_2 requires six<2 and >=1.9.0

Dependency tree:
- package_5 requires package_1
  - package_1 requires six<1.9
- package_4 requires package_3
  - package_3 requires package_2
    - package_2 requires six<2 and >=1.9.0

To fix this you could try to:
- ask the package maintainers to loosen their dependencies

ERROR: ResolutionImpossible For help visit: https://pip.pypa.io/en/stable/user_guide/#dependency-conflicts-resolution-impossible

Package conflicting with itself

ERROR: Cannot install testpkg because of conflicting dependencies.

The conflict is caused by:
    testpkg requires six<1.9
    testpkg requires six<2 and >=1.9.0

Dependency tree:
- testpkg requires six<1.9
- testpkg requires virtualenv==20.0.25
  - virtualenv requires six<2 and >=1.9.0

To fix this you could try to:
- ask the package maintainers to fix the conflict

ERROR: ResolutionImpossible For help visit: https://pip.pypa.io/en/stable/user_guide/#dependency-conflicts-resolution-impossible
@tiangolo
Copy link

This would be very useful! ☝️

Additionally or alternatively, as the ResolutionImpossible might show up after 30 min or some hours, I would find it very useful to show what packages depend on something that triggers the backtracking process.

For example:

INFO: pip is looking at multiple versions of six to determine which version is compatible with other requirements. This could take a while.
INFO: package foo requires six >1.5 <2.0
INFO: package bar requires six >1.0 <1.5
Collecting six>=1.5

I understand that for the backtracking to start it's because it is already known that something (in this case foo) depends on six with some version specifier and something else (in this case bar) is also depending on six.


Even better, from my point of view at least, would be to show what has a requirement on each package currently being downloaded and installed. Maybe only with --verbose if that's a concern. That way I could manually look at the logs and see which packages are triggering backtracking, then check they are required by what, and then check in each of those requiring packages what are the version conflicts.

For example:

Collecting starlette==0.14.2
  Required by fastapi==0.65.2: starlette ==0.14.2
  Required by ariadne==0.13.0: starlette <0.15
  Using cached starlette-0.14.2-py3-none-any.whl (60 kB)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: dependency resolution About choosing which dependencies to install C: error messages Improving error messages
Projects
None yet
Development

No branches or pull requests

4 participants