Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Virtualenv defines an alias for the command deactivate as seen in yourvirtualenv/bin/activate.csh. What I'm curious about is where deactivate resides, because when I issue an alias command deactivate does not appear in the list of active aliases.

share|improve this question
up vote 0 down vote accepted

Assuming that you're actually running bash rather than csh, the script you want to look at is yourvirtualenv/bin/activate (not yourvirtualenv/bin/activate.csh), which defines a function called deactivate, not an alias. You can see this with the type command:

$ type deactivate
deactivate is a function
deactivate () 
    typeset env_postdeactivate_hook;
    typeset old_env;
    virtualenvwrapper_run_hook "pre_deactivate";
    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;
share|improve this answer
I saw the function definition as well, but did not know how it related to the alias in the .csh file. Thanks a lot! Had no idea that you could define functions in this manner, as well as type out their definitions. – Parham Oct 24 '13 at 15:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.