Consider warning users about shell path hashing on upgrade #6863
Labels
C: cli
Command line interface related things (optparse, option grouping etc)
C: scripts
How scripts and entry points are managed
state: awaiting PR
Feature discussed, PR is needed
type: enhancement
Improvements to functionality
What's the problem this feature will solve?
Shells can remember paths to commands, so subsequent invocations do not have to search
PATH
. This causes confusing behavior when executingpip install --upgrade pip
, but a regularpip
invocation still resolves to the system pip (at/usr/bin/pip
) and import fails.Describe the solution you'd like
On package upgrade, check whether the parent process is bash (or any shell that does this). If so, check whether the script that was just installed also exists anywhere else in
PATH
. If so, print a warning to the user that they may need to execute e.g.hash <script1> <script2> ...
before the scripts will work correctly.Example where this would've helped: #6332.
Alternative Solutions
Additional context
The text was updated successfully, but these errors were encountered: