views:

1011

answers:

2

I'm using virtualenv and the virtualenvwrapper. I can switch between virtualenv's just fine using the workon command.

me@mymachine:~$ workon env1
(env1)me@mymachine:~$ workon env2
(env2)me@mymachine:~$ workon env1
(env1)me@mymachine:~$

However, how do I exit all virtual machines and workon my real machine again? Right now, the only way I have of getting back to

me@mymachine:~$

is to exit the shell and start a new one. That's kind of annoying. Is there a command to workon "nothing", and if so, what is it? If such a command does not exist, how would I go about creating it?

+10  A: 

Usually, activating a virtualenv gives you a command:

$ deactivate

which puts things back to normal.

Edit: I have just looked specifically again at the code for virtualenvwrapper, and, yes, it too supports "deactivate" as the way to escape from all virtualenvs.

Brandon Craig Rhodes
Thanks! Surprising that this isn't prominently mentioned, if at all, in the documentation.
Apreche
A: 

Alternatively, run source /etc/profile.

alex
But that could wipe out all sorts of quite normal customizations that your own .profile (or equivalent) adds to your shell, and throw you into a raw un-customized state that your shell is never otherwise actually in.
Brandon Craig Rhodes