diff --git a/news/8733.bugfix b/news/8733.bugfix new file mode 100644 index 00000000000..94206119c21 --- /dev/null +++ b/news/8733.bugfix @@ -0,0 +1 @@ +Correctly uninstall console scripts installed to ~/.local/bin \ No newline at end of file diff --git a/src/pip/_internal/locations.py b/src/pip/_internal/locations.py index 0c1235488d6..a5ce599f76c 100644 --- a/src/pip/_internal/locations.py +++ b/src/pip/_internal/locations.py @@ -72,8 +72,10 @@ def get_src_prefix(): # Use getusersitepackages if this is present, as it ensures that the # value is initialised properly. user_site = site.getusersitepackages() + user_base = site.getuserbase() except AttributeError: user_site = site.USER_SITE + user_base = site.USER_BASE if WINDOWS: bin_py = os.path.join(sys.prefix, 'Scripts') @@ -84,7 +86,7 @@ def get_src_prefix(): bin_user = os.path.join(user_site, 'bin') else: bin_py = os.path.join(sys.prefix, 'bin') - bin_user = os.path.join(user_site, 'bin') + bin_user = os.path.join(user_base, 'bin') # Forcing to use /usr/local/bin for standard macOS framework installs # Also log to ~/Library/Logs/ for use with the Console.app log viewer