ohmyzsh: virtualenvwrapper plugin: deactivate returns error
I’ve enabled the virtualenvwrapper plugin and added a .venv file to my project folder. When I cd to it my venv is activated successfully and when I cd out of it it is deactivated successfully. So far so good. However when I manually run deactivate while inside the directory I get the following:
deactivate:12: command not found: virtualenv_deactivate
Issuing which deactivate (before getting above error) returns the following:
deactivate () {
typeset env_postdeactivate_hook
typeset old_env
virtualenvwrapper_run_hook "pre_deactivate"
env_postdeactivate_hook="$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR/postdeactivate"
old_env=$(basename "$VIRTUAL_ENV")
virtualenv_deactivate $1
virtualenvwrapper_run_hook "post_deactivate" "$old_env"
if [ ! "$1" = "nondestructive" ]
then
unset -f virtualenv_deactivate > /dev/null 2>&1
unset -f deactivate > /dev/null 2>&1
fi
}
Some notes:
- I am not sourcing
virtualenvwrapper.shin my.zshrc(as it sourced by the plugin) - I have installed
virtualenvwrapper==4.1.1throughpip. - My Python (2.7.5) was installed with
homebrew
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Comments: 22 (12 by maintainers)
Commits related to this issue
- virtualenvwrapper: Deactivate only if in virtualenv If user manually deactivates the virtualenv when using this mode, zsh will produce following error: deactivate:12: command not found: virtuale... — committed to nailor/oh-my-zsh by deleted user 9 years ago
- virtualenvwrapper: Deactivate only if in virtualenv If user manually deactivates the virtualenv when using this mode, zsh will produce following error: deactivate:12: command not found: virtuale... — committed to LunaCodeGirl/oh-my-zsh by deleted user 9 years ago
- virtualenvwrapper: Deactivate only if in virtualenv If user manually deactivates the virtualenv when using this mode, zsh will produce following error: deactivate:12: command not found: virtuale... — committed to stoye/oh-my-zsh by deleted user 9 years ago
- virtualenvwrapper: Deactivate only if in virtualenv If user manually deactivates the virtualenv when using this mode, zsh will produce following error: deactivate:12: command not found: virtuale... — committed to TonyLovesDevOps/oh-my-zsh by deleted user 9 years ago
- virtualenvwrapper: Deactivate only if in virtualenv If user manually deactivates the virtualenv when using this mode, zsh will produce following error: deactivate:12: command not found: virtuale... — committed to lewg/oh-my-zsh by deleted user 9 years ago
- virtualenvwrapper: Deactivate only if in virtualenv If user manually deactivates the virtualenv when using this mode, zsh will produce following error: deactivate:12: command not found: virtuale... — committed to cabbiepete/oh-my-zsh by deleted user 9 years ago
- virtualenvwrapper: Deactivate only if in virtualenv If user manually deactivates the virtualenv when using this mode, zsh will produce following error: deactivate:12: command not found: virtuale... — committed to e2/oh-my-zsh by deleted user 9 years ago
- virtualenvwrapper: Deactivate only if in virtualenv If user manually deactivates the virtualenv when using this mode, zsh will produce following error: deactivate:12: command not found: virtuale... — committed to kirb/oh-my-zsh by deleted user 9 years ago
- virtualenvwrapper: Deactivate only if in virtualenv If user manually deactivates the virtualenv when using this mode, zsh will produce following error: deactivate:12: command not found: virtuale... — committed to NobbZ/oh-my-zsh by deleted user 9 years ago
- virtualenvwrapper: Deactivate only if in virtualenv If user manually deactivates the virtualenv when using this mode, zsh will produce following error: deactivate:12: command not found: virtuale... — committed to fforw/oh-my-zsh by deleted user 9 years ago
I had a similar problem and fixed by changing the order of commands im my .zshrc. I put the lines that export virtualenv settings before sourcing .oh-my-zsh script.
+1