Leaving and Switching Between Virtual Environments
00:11 So again, I am going to jump to the terminal for this. Alright, so I am back in my example project, inside an active virtual environment. Now, how do you get back to the global environment if you are inside an active virtual env?
The global environment does not support this deactivate command. Now you can see here that when I ran the
deactivate command, it actually removed this little marker here, from my shell prompt, so now I can tell that I am back in the global environment.
00:51 One more thing I wanted to mention is how do you actually switch between different virtual environments if you are working with multiple projects. So right now I am still in this virtual environment for my test project here, and what I am going to do here is I am going to leave that environment and then I am going to go to a different project folder that also has a virtual environment.
And here, I would just use the same
activate command to switch into that virtual environment and then start working from here. And it’s a good idea to deactivate or leave an active virtual environment before you go and activate or enter a new environment.
Become a Member to join the conversation.