Skip to content

Commit

Permalink
Fix uninstallation of user scripts
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DaanDeMeyer committed Aug 8, 2020
1 parent 2e4d748 commit cfe82ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/8733.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Correctly uninstall console scripts installed to ~/.local/bin
5 changes: 3 additions & 2 deletions src/pip/_internal/locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,17 @@ def get_src_prefix():
except AttributeError:
user_site = site.USER_SITE

bin_user = sysconfig.get_path('scripts')
assert bin_user is not None

if WINDOWS:
bin_py = os.path.join(sys.prefix, 'Scripts')
bin_user = os.path.join(user_site, 'Scripts')
# buildout uses 'bin' on Windows too?
if not os.path.exists(bin_py):
bin_py = os.path.join(sys.prefix, 'bin')
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')

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

0 comments on commit cfe82ea

Please sign in to comment.