diff --git a/modules/python/init.zsh b/modules/python/init.zsh index fa9175e5..496f4221 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -16,9 +16,12 @@ elif (( $+commands[pyenv] )); then eval "$(pyenv init -)" # Prepend PEP 370 per user site packages directory, which defaults to -# ~/Library/Python on Mac OS X and ~/.local elsewhere, to PATH. +# ~/Library/Python on Mac OS X and ~/.local elsewhere, to PATH. The +# path can be overridden using PYTHONUSERBASE. else - if [[ "$OSTYPE" == darwin* ]]; then + if [[ -n $PYTHONUSERBASE ]]; then + path=($PYTHONUSERBASE/bin $path) + elif [[ "$OSTYPE" == darwin* ]]; then path=($HOME/Library/Python/*/bin(N) $path) else # This is subject to change.