diff --git a/plugins/pyenv/README.md b/plugins/pyenv/README.md index f18fc8cfb..95d79cb52 100644 --- a/plugins/pyenv/README.md +++ b/plugins/pyenv/README.md @@ -2,7 +2,7 @@ This plugin looks for [pyenv](https://github.com/pyenv/pyenv), a Simple Python version management system, and loads it if it's found. It also loads pyenv-virtualenv, a pyenv -plugin to manage virtualenv, if it's found. +plugin to manage virtualenv, if it's found. If a venv is found pyenv won't load. To use it, add `pyenv` to the plugins array in your zshrc file: diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh index 48c8ffaf5..b5c9a7bd3 100644 --- a/plugins/pyenv/pyenv.plugin.zsh +++ b/plugins/pyenv/pyenv.plugin.zsh @@ -1,3 +1,7 @@ +# if there is a virtualenv already loaded pyenv should not be loaded +# see https://github.com/ohmyzsh/ohmyzsh/issues/12589 +[[ -n ${VIRTUAL_ENV:-} ]] && return + pyenv_config_warning() { [[ "$ZSH_PYENV_QUIET" != true ]] || return 0