Skip to content

Commit cfe82ea

Browse files
committed
Fix uninstallation of user scripts
User scripts are installed to ~/.local/bin. pip was looking for scripts to uninstall in ~/.local/lib/python3.8/site-packages/bin. This commit makes it look in ~/.local/bin instead.
1 parent 2e4d748 commit cfe82ea

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

news/8733.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Correctly uninstall console scripts installed to ~/.local/bin

src/pip/_internal/locations.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,17 @@ def get_src_prefix():
7575
except AttributeError:
7676
user_site = site.USER_SITE
7777

78+
bin_user = sysconfig.get_path('scripts')
79+
assert bin_user is not None
80+
7881
if WINDOWS:
7982
bin_py = os.path.join(sys.prefix, 'Scripts')
80-
bin_user = os.path.join(user_site, 'Scripts')
8183
# buildout uses 'bin' on Windows too?
8284
if not os.path.exists(bin_py):
8385
bin_py = os.path.join(sys.prefix, 'bin')
8486
bin_user = os.path.join(user_site, 'bin')
8587
else:
8688
bin_py = os.path.join(sys.prefix, 'bin')
87-
bin_user = os.path.join(user_site, 'bin')
8889

8990
# Forcing to use /usr/local/bin for standard macOS framework installs
9091
# Also log to ~/Library/Logs/ for use with the Console.app log viewer

0 commit comments

Comments
 (0)