diff --git a/modules/python/init.zsh b/modules/python/init.zsh index da78ea79..c833d4dd 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -34,17 +34,22 @@ if (( ! $+commands[python] && ! $+commands[pyenv] )); then return 1 fi +# Load pyenv-virtualenv into the shell session. +if (( $+commands[pyenv-virtualenv] )); then + eval "$(pyenv virtualenv-init -)" +fi + # Load virtualenvwrapper into the shell session. if (( $+commands[virtualenvwrapper.sh] )); then # Set the directory where virtual environments are stored. export WORKON_HOME="$HOME/.virtualenvs" - # Disable the virtualenv prompt. - VIRTUAL_ENV_DISABLE_PROMPT=1 - source "$commands[virtualenvwrapper.sh]" fi +# Disable the virtualenv prompt. +VIRTUAL_ENV_DISABLE_PROMPT=1 + # # Aliases #