Deactivating a Virtual Environment
When you’re done working on a project, you may want to go back to using the global Python or switch to a different virtual environment. This is easy to do using the deactivate
command. In this lesson you’ll see how to deactivate and re-activate virtual environments.
00:00
Now the question is, “Okay, how do I get back to the global environment?” And it’s pretty easy to do. So, when you’re inside a virtual environment you can just use the deactivate
command, which is part of any enabled, any active virtual env.
00:13
So when I run this command, it’s going to take me back to the global environment, and now when I go which pip3
it’s going to point to the global environment here again.
00:23 And then if I wanted to go back into the virtual environment, I would do the same thing and it would turn it back on. All right, now I’m back in, and now we’re back out. Cool!
Become a Member to join the conversation.
koinonia9912 on July 23, 2020
Please consider discussing virtual environments when using miniconda3 and anaconda3 and also using pip3 all on same machine, and how to avoid complications. Also, if the system-wide install environment has no name when using pip3 but has the name (base) in conda environment?
I was able to change the default python environment in Visual Studio 2019