pipenv icon indicating copy to clipboard operation
pipenv copied to clipboard

Missing info for package conflict

Open boonware opened this issue 2 years ago • 15 comments

Issue description

When a dependency conflict occurs, on many occasions I see that there is not sufficient information to diagnose the conflict. This can sometimes occur when first installing a project, so I cannot run pipenv graph as no dependencies are installed (installation fails). For example, in the trace below we can see that pyspark==3.3.2 fails to install due to a conflict, but a conflict with what?

home$ pipenv install 'pyspark==3.3.2'
Loading .env environment variables...
Installing pyspark==3.3.2...
Resolving pyspark==3.3.2...
Adding pyspark to Pipfile's [packages] ...
✔ Installation Succeeded
Pipfile.lock (3ffa3e) out of date, updating to (2149eb)...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
Resolving dependencies...
✘ Locking Failed!
⠏ Locking...
CRITICAL:pipenv.patched.pip._internal.resolution.resolvelib.factory:Cannot install -r /var/folders/ts/ypl0gvnn55z1y7gydrghpdxc0000gn/T/pipenv-2dq4knuw-requirements/pipenv-sdc6xfpf-constraints.txt (line 10), -r /var/folders/ts/ypl0gvnn55z1y7gydrghpdxc0000gn/T/pipenv-2dq4knuw-requirements/pipenv-sdc6xfpf-constraints.txt (line 12) and pyspark==3.3.2 because these package versions have conflicting dependencies.
[ResolutionFailure]:   File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/resolver.py", line 704, in _main
[ResolutionFailure]:       resolve_packages(
[ResolutionFailure]:   File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/resolver.py", line 662, in resolve_packages
[ResolutionFailure]:       results, resolver = resolve(
[ResolutionFailure]:       ^^^^^^^^
[ResolutionFailure]:   File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/resolver.py", line 642, in resolve
[ResolutionFailure]:       return resolve_deps(
[ResolutionFailure]:       ^^^^^^^^^^^^^
[ResolutionFailure]:   File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 1167, in resolve_deps
[ResolutionFailure]:       results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
[ResolutionFailure]:       ^^^^^^^^^^^^^^^^^^^^^^
[ResolutionFailure]:   File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 948, in actually_resolve_deps
[ResolutionFailure]:       resolver.resolve()
[ResolutionFailure]:   File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 690, in resolve
[ResolutionFailure]:       raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv run pip install <requirement_name> to bypass this mechanism, then run $ pipenv graph to inspect the versions actually installed in the virtualenv.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Expected result

The logs will show why the conflict occurs, i.e. what packages are conflicting.

Details

pipenv, version 2023.7.23

boonware avatar Aug 04 '23 09:08 boonware