From 56a2e950e31da1f2b9f29627e285d5ac2262a5d0 Mon Sep 17 00:00:00 2001 From: monai Date: Fri, 9 Oct 2015 17:17:20 +0300 Subject: [PATCH] Add support for pyenv-virtualenv --- modules/python/init.zsh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 #