Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List all virtualenv

In virtualenvwrapper, is there a simple way to list all virtualenv on my machine?

(like what yolk -l does to list all python packages in the current virtual environment?)

CLARIFICATION: "ls -la" in my env directory does not count. I am looking for a virtualenv or virtualenvwrapper specific command.

like image 527
Calvin Cheng Avatar asked Aug 27 '11 02:08

Calvin Cheng


People also ask

How do I see all virtual environments in Python?

To see a list of the Python virtual environments that you have created, you can use the 'conda env list' command. This command will give you the names as well as the filesystem paths for the location of your virtual environments.

How do I find my virtualenv?

The most popular and widely used of these projects is virtualenv, which handles creating the directory structure and copying the needed files into a virtual environment. To install virtualenv, just use pip install virtualenv . To create a virtual environment directory with it, type virtualenv /path/to/directory .

How do I know if virtualenv is activated?

Note: Before installing a package, look for the name of your virtual environment within parentheses just before your command prompt. In the example above, the name of the environment is venv . If the name shows up, then you know that your virtual environment is active, and you can install your external dependencies.

What is venv name?

The folder with the name venv is created that contains all the necessary executables to run the Python project. This is the folder where all your python packages will run. To specify the Python interpreter of your choice, you can do it easily by specifying Python{version-name}.


1 Answers

You can use the lsvirtualenv, in which you have two options "long" or "brief":

"long" option is the default one, it searches for any hook you may have around this command and executes it, which takes more time.

"brief" just take the virtualenvs names and prints it.

brief usage:

$ lsvirtualenv -b 

long usage:

$ lsvirtualenv -l 

if you don't have any hooks, or don't even know what i'm talking about, just use "brief".

like image 128
Bengineer Avatar answered Sep 17 '22 15:09

Bengineer