.bashrc: Add `pip --user` bin directories to $PATH
authorTony Duckles <tony@nynim.org>
Sat, 3 Mar 2018 18:15:23 +0000
committerTony Duckles <tony@nynim.org>
Sat, 3 Mar 2018 18:15:23 +0000
.bashrc

diff --git a/.bashrc b/.bashrc
index 77d8178234e857c1bb926246833dcad3d7ced846..469614106b3ac8729eba61139d74bdb5c67bbb56 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -105,6 +105,14 @@ if [ -d "/native" ]; then
     manpath_end="$manpath_end:/native/usr/share/man"
 fi
 
+# python pip --user
+for python in "python" "python2" "python3"; do
+    if [ -n "$(type -P $python)" ]; then
+        pybin="$($python -m site --user-base)/bin"
+        test -d "$pybin" && path_end="$path_end:$pybin"
+    fi
+done
+unset python pybin
 
 PATH="$path_start:$PATH:$path_end"
 MANPATH="$manpath_start:$MANPATH:$manpath_end"