This is inspired by this GH issue, and our work on providing users with understand of what’s happening with pip is backtracking.
With the new resolver, while pip is looking for a compatible set of depenedency package versions to install, it needs to (currently) download each version in order to work out if it is compatible or not.
As @pradyunsg, @pf_moore, and @uranusjr mention in 8713 above, pip has no current way to know if the package version it’s about to download is compatible.
Suggestions of including dependency information in metadata would take a lot of development time. This option would be preferred.
From the perspective of the user, even if they do not understand why pip needs to do this (and we can’t expect them to understand, or even need to understand), they will understand these packages are no longer required - so why does pip not clean up after itself? This is a reasonable request - pip currently does that after an install anyway.
As an interim, I’d like to suggest the following -
At the end of the (successful) installation process, I’d like pip to do one of these (1. most preferred to 3. least preferred):
1. Prompt the user “Do you want me to remove the packages I downloaded in order to find the compatible one?” Y/N/Not sure
- Y: deletes the packages pip had to download during that install process
- N/Not sure: does not delete them
Most preferred as it informs the user of a potentially important decision. (If most people say "I don’t care about these packages, just delete them, then option 3 below would be preferred)
2. print a message for the user to explain how they can remove those packages?
pip prints a message
To save your storage space, you can delete the interim package versions by typing: rm (-rf) /path/to/where/the/packages/are-stored/
Not ideal, however it still saves a user in this situation from loosing disk-space to not longer needed packages.
3. automatically remove the “incompatible” package versions
Not ideal either as the system has done something the user may not want to have happen.
Easiest to implement would be 2 (essentially printing a message).
Thoughts?