File: resolution-impossible-example.md

package info (click to toggle)
python-pip 25.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 7,048 kB
  • sloc: python: 82,877; sh: 75; makefile: 25
file content (92 lines) | stat: -rw-r--r-- 3,181 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
---
orphan:
---

# Example error: ResolutionImpossible

## What if there are user-provided pinned packages?

Where a user wants to install packages (with 1 or more pinned version)
with default verbose level

```
$ pip install peach=1.0 apple=2.0

Due to conflicting dependencies pip cannot install Peach1.0 and Apple2.0:

* Peach 1.0 depends on Banana 3.0
* Apple2.0 depends on Banana2.0

There are a number of possible solutions. You can try:
1. removing package versions from your requirements, and letting pip try to resolve the problem for you
2. Trying  a version of Peach that depends on Banana2.0. Try `pip-search peach —dep banana2.0`
3. replacing Apple or Peach with a different package altogether
4. patching Apple2.0 to use Banana3.0
5. 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.
```

**with verbose level -vv**

If a user ran the same pip command with more verbosity, what would they see?

**with verbose level -vvv**

If a user ran the same pip command with more verbosity, what would they see?

## What if there are no user-provided version restrictions?

NB: We are assuming this resolver behaviour gets implemented, based on [GH issues 8249](https://github.com/pypa/pip/issues/8249).

**with default verbose level**

```
$ pip install apple peach

Due to conflicting dependencies pip cannot install apple or peach. Both depend on banana, but pip can't find a version of either where they depend on the same banana version.

There are a number of possible solutions. You can try:
1. replacing apple or peach with a different package altogether
2. patching apple or peach to use the same version of banana
3. force installing (Be aware!)

To debug this further you can run pip-tree to see all of your dependencies.
```

**with verbose level -vv**

If a user ran the same pip command with more verbosity, what would they see?

**with verbose level -vvv**

If a user ran the same pip command with more verbosity, what would they see?

**What should be in the "documentation" page?**

* ways to swap a package for another
* how to patch a package to support a version (various ways)

## Recommendations

* Write official documentation / guide "How to resolve dependency conflicts" explaining:
  * Why conflicts can exist
  * How you can avoid them (pinning)
  * How you can resolve them
    * Use alternative package
    * Use older version
    * Patch package
* Introduce new commands to pip, inspired by poetry:
  * Tree: Show full tree of dependencies
  * Show `<package>` Show details of a package, including it's dependencies
  * latest - shows latest vs installed versions
  * outdated - shows only outdated versions
* Expose commands / help link in output??
  * when particular issue happens provide ways to move on (ala pipenv), e.g.
    * run this command to see X
    * is it your internet connection?
    * is it the pypi website?
* Aspirational commands
  * `pip search PackageName —dep PackageNameVersion`
    * a command that will search for a version of a package that has a dependency on another packageversion