Destroying Virtual Environments
00:00 Now what do you do once you’re done with the virtual environment, or you want to recreate it from scratch? How do you get rid of them? Because, if you’re working with virtual environments over time, you are going to accumulate a couple of them, if you’re creating one per project, and so what do you do when you want to get rid of these virtual environments to reclaim the space they take up?
I am going to show you how to do that now. So we’re going to delete an existing virtual environment here… So right now, I am in this test project folder, and I am inside and active virtual environment; so in order to delete this virtual environment, I would first of all deactivate the environment so that we’re back in the global environment, and then all you need to do is delete this
So, what I am going to do here is I am going to delete it using the
rm command and you always want to be careful when you are running this command just as a word of warning, because you can easily delete a bunch of stuff that maybe you don’t want to delete.
But I am going to go ahead here and I am just going to delete this folder, and now you can see the project folder is empty or I actually deleted this
venv folder, which means now the virtual environment is gone, it doesn’t take up any space anymore and if I wanted to, I could recreate a virtual environment under the same name and then just repopulate again and configure it in the way I want.
Become a Member to join the conversation.