|
| 1 | +--- |
| 2 | +orphan: |
| 3 | +--- |
| 4 | + |
| 5 | +# Example error: ResolutionImpossible |
| 6 | + |
| 7 | +## What if there are user-provided pinned packages? |
| 8 | + |
| 9 | +Where a user wants to install packages (with 1 or more pinned version) |
| 10 | +with default verbose level |
| 11 | + |
| 12 | +``` |
| 13 | +$ pip install peach=1.0 apple=2.0 |
| 14 | +
|
| 15 | +Due to conflicting dependencies pip cannot install Peach1.0 and Apple2.0: |
| 16 | +
|
| 17 | +* Peach 1.0 depends on Banana 3.0 |
| 18 | +* Apple2.0 depends on Banana2.0 |
| 19 | +
|
| 20 | +There are a number of possible solutions. You can try: |
| 21 | +1. removing package versions from your requirements, and letting pip try to resolve the problem for you |
| 22 | +2. Trying a version of Peach that depends on Banana2.0. Try `pip-search peach —dep banana2.0` |
| 23 | +3. replacing Apple or Peach with a different package altogether |
| 24 | +4. patching Apple2.0 to use Banana3.0 |
| 25 | +5. force installing (Be aware!) |
| 26 | +
|
| 27 | +For instructions on how to do these steps visit: https://pypa.io/SomeLink |
| 28 | +To debug this further you can run `pip-tree` to see all of your dependencies. |
| 29 | +``` |
| 30 | + |
| 31 | +**with verbose level -vv** |
| 32 | + |
| 33 | +If a user ran the same pip command with more verbosity, what would they see? |
| 34 | + |
| 35 | +**with verbose level -vvv** |
| 36 | + |
| 37 | +If a user ran the same pip command with more verbosity, what would they see? |
| 38 | + |
| 39 | +## What if there are no user-provided version restrictions? |
| 40 | + |
| 41 | +NB: We are assuming this resolver behaviour gets implemented, based on [GH issues 8249](https://github.com/pypa/pip/issues/8249). |
| 42 | + |
| 43 | +**with default verbose level** |
| 44 | + |
| 45 | +``` |
| 46 | +$ pip install apple peach |
| 47 | +
|
| 48 | +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. |
| 49 | +
|
| 50 | +There are a number of possible solutions. You can try: |
| 51 | +1. replacing apple or peach with a different package altogether |
| 52 | +2. patching apple or peach to use the same version of banana |
| 53 | +3. force installing (Be aware!) |
| 54 | +
|
| 55 | +To debug this further you can run pip-tree to see all of your dependencies. |
| 56 | +``` |
| 57 | + |
| 58 | +**with verbose level -vv** |
| 59 | + |
| 60 | +If a user ran the same pip command with more verbosity, what would they see? |
| 61 | + |
| 62 | +**with verbose level -vvv** |
| 63 | + |
| 64 | +If a user ran the same pip command with more verbosity, what would they see? |
| 65 | + |
| 66 | +**What should be in the "documentation" page?** |
| 67 | + |
| 68 | +* ways to swap a package for another |
| 69 | +* how to patch a package to support a version (various ways) |
| 70 | + |
| 71 | +## Recommendations |
| 72 | + |
| 73 | +* Write official documentation / guide "How to resolve dependency conflicts" explaining: |
| 74 | + * Why conflicts can exist |
| 75 | + * How you can avoid them (pinning) |
| 76 | + * How you can resolve them |
| 77 | + * Use alternative package |
| 78 | + * Use older version |
| 79 | + * Patch package |
| 80 | +* Introduce new commands to pip, inspired by poetry: |
| 81 | + * Tree: Show full tree of dependencies |
| 82 | + * Show `<package>` Show details of a package, including it's dependencies |
| 83 | + * latest - shows latest vs installed versions |
| 84 | + * outdated - shows only outdated versions |
| 85 | +* Expose commands / help link in output?? |
| 86 | + * when particular issue happens provide ways to move on (ala pipenv), e.g. |
| 87 | + * run this command to see X |
| 88 | + * is it your internet connection? |
| 89 | + * is it the pypi website? |
| 90 | +* Aspirational commands |
| 91 | + * `pip search PackageName —dep PackageNameVersion` |
| 92 | + * a command that will search for a version of a package that has a dependency on another packageversion |
0 commit comments