Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I remove/delete a virtualenv?

I created an environment with the following command: virtualenv venv --distribute

I cannot remove it with the following command: rmvirtualenv venv - This is part of virtualenvwrapper as mentioned in answer below for virtualenvwrapper

I do an lson my current directory and I still see venv

The only way I can remove it seems to be: sudo rm -rf venv

Note that the environment is not active. I'm running Ubuntu 11.10. Any ideas? I've tried rebooting my system to no avail.

like image 317
wulymammoth Avatar asked Jun 12 '12 21:06

wulymammoth


People also ask

How do you delete a virtual environment in powershell?

If virtual environment was activated using Powershell script - Activate. ps1, the Deactivate. ps1 was not created, while the documentation says that it should. "You can deactivate a virtual environment by typing “deactivate” in your shell.

How do I delete a virtual environment in PyCharm?

You can clean out old PyCharm interpreters that are no longer associated with a project via Settings -> Project Interpreter, click on the gear in the top right, then click "More". This gives you a listing where you can get rid of old virtualenvs that PyCharm thinks are still around.

How do I disable virtualenv Windows?

Just type "workon" with no arguments and hit enter. The command to leave is "deactivate", as answered below.


2 Answers

"The only way I can remove it seems to be: sudo rm -rf venv"

That's it! There is no command for deleting your virtual environment. Simply deactivate it and rid your application of its artifacts by recursively removing it.

Note that this is the same regardless of what kind of virtual environment you are using. virtualenv, venv, Anaconda environment, pyenv, pipenv are all based the same principle here.

like image 167
Thomas Anthony Avatar answered Sep 28 '22 10:09

Thomas Anthony


Just to echo what @skytreader had previously commented, rmvirtualenv is a command provided by virtualenvwrapper, not virtualenv. Maybe you didn't have virtualenvwrapper installed?

See VirtualEnvWrapper Command Reference for more details.

like image 26
Devy Avatar answered Sep 28 '22 10:09

Devy