-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Missing info for package conflict #5823
Comments
@boonware Have you tried running with |
Hi @matteius, I can confirm the same. I've reproduced it with a clean Docker machine with the following Pipfile
With pipenv 2023.07.23
With pipenv 2023.07.11
As you can see, with 2023.07.11 we get
but not with 2023.07.23. I've tried also with the |
@boonware I think the problem is the error logging in the sub-process doesn't make it to the parent process. That being said, it maybe the same, but could you also check the behavior with: #5793 |
Yes, this does not show the conflict either. |
I'll try out this option for my problem. It would be nice if the temporary file that is created and is referred to in the verbose error message as containing the conflicting package was somehow kept or had its contents logged on error, e.g. |
@kalebmckale I think its a great point of frustration for many users and we should aim to improve the inter-process communication so that the output generated by pip is not lost. Certainly there are some skilled python devs out there that can help once we merge the draft-no-reqslib branch. 🤞 I am about ready to merge that branch because at this point it fixes more issue reports than it causes, and I haven't heard any negative feedback about yet on something that hasn't been addressed or isn't already an issue. Having the resolver run in the parent process should yield more output, but just be aware if the parent python is a different version than the project python it may not be a consistent result. |
Thanks for the word of caution. I will probably hold off until the next version instead. |
I pushed a change to the future looking pipenv branch which get the |
I will be able to test it at work tomorrow. I'm off today. Will let you know then. |
Discussed on #5793 and verbose output has greatly improved. |
I believe the new release solves this. |
Whats in the new release that resolves it?. Still does this for me and I'm mystified as to what actually is the thing thats conflicting. Like, couldnt it just say "Hey this thing wants version x but that thing wants version y"? |
Not solved at all @matteius please reopen |
ok just figured out you can check the cause via |
Analysis for Issue #5823: Analysis of Pipenv Issue #5823: Missing info for package conflict1. Main ProblemThe issue reports that Pipenv sometimes fails to provide enough information about dependency conflicts during package resolution, especially when installing a new project. This makes it difficult for users to diagnose and resolve the conflict, as they are not told which packages are causing the issue. 2. Comments Discussion
3. Proposed ResolutionThe root cause seems to be the lack of proper error handling and communication between the main Pipenv process and the subprocess running the resolver. This can be resolved by:
4. Potential Code ChangesThis snippet shows a potential way to implement the proposed changes, focusing on error handling: # pipenv/utils/resolver.py - inside venv_resolve_deps() function
try:
results, hashes, internal_resolver = actually_resolve_deps(...)
except ResolutionFailure as e:
error_message = str(e)
# Try to extract conflict information from the exception.
try:
causes = e.__cause__.causes
conflicting_packages = [
cause.requirement.name for cause in causes
]
error_message += (
f"\nThe following packages have conflicting dependencies: "
f"{', '.join(conflicting_packages)}"
)
except AttributeError:
# Conflict information not available, advise using --verbose.
error_message += (
"\nPlease try again with the '--verbose' flag for more details."
)
raise ResolutionFailure(message=error_message) 5. Additional Steps
By implementing these changes, Pipenv can become more user-friendly by providing clearer and more actionable information about dependency conflicts. |
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 thatpyspark==3.3.2
fails to install due to a conflict, but a conflict with what?Expected result
The logs will show why the conflict occurs, i.e. what packages are conflicting.
Details
pipenv, version 2023.7.23
The text was updated successfully, but these errors were encountered: