JamesWang
JamesWang

Reputation: 1545

what's command to list all the virtual environments in venv?

I know in conda I can use conda env list to get a list of all conda virtual environments, what's the corresponding command in python venv that can list all the virtual environments in a given venv? also, is there any way I can print/check the directory of current venv? somehow I have many projects that have same name .venv for their virtual environment and I'd like to find a way to verify which venv I'm in. Thanks

Upvotes: 12

Views: 69748

Answers (2)

bellet binu
bellet binu

Reputation: 1

Simply use lsvirtualenv in the parent directory in CMD. This will show the list of all venv. if you want to open a specific one from the listed type workon(env_name). Then hit Enter

Upvotes: -1

Python Newbie
Python Newbie

Reputation: 381

Virtual environments are simple a set of files in a directory on your system. You can find them the same way you would find images or documents with a certain name. For example, if you are using Linux or macOS, you could run find / | grep bin/activate in terminal. Not too sure about Windows but I suspect you can search for something similar in Windows Explorer.

Upvotes: 6

Related Questions