diff --git a/modules/python/README.md b/modules/python/README.md index 2ef025eb..5a51c3a3 100644 --- a/modules/python/README.md +++ b/modules/python/README.md @@ -9,9 +9,9 @@ This module will prepend the per user site packages directory as defined in [PEP man pages installed into the per user site. It also sources the [_virtualenvwrapper_][2] initialization script, if -[_virtualenvwrapper_][2] is installed. [_virtualenvwrapper_][2] is a frontend -to [_virtualenv_][3] which provides convenient shell functions to create, switch -and manage virtualenvs. +[_virtualenvwrapper_][2] is installed and `$WORKON_HOME` is set. +[_virtualenvwrapper_][2] is a frontend to [_virtualenv_][3] which provides +convenient shell functions to create, switch and manage virtualenvs. Authors ------- diff --git a/modules/python/init.zsh b/modules/python/init.zsh index 17120174..64fde25c 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -21,6 +21,8 @@ else fi # source virtualenvwrapper if available -if (( $+commands[virtualenvwrapper.sh] )); then - source virtualenvwrapper.sh +if (( $+WORKON_HOME )); then + if (( $+commands[virtualenvwrapper.sh] )); then + source virtualenvwrapper.sh + fi fi