问题
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.
回答1:
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".
回答2:
Silly question. Found that there's a
lsvirtualenv
command which lists all existing virtualenv.
回答3:
Run workon with no argument to list available environments.
回答4:
To list all the virtual environments (if using the anaconda distribution):
conda info --envs
Hope my answer helps someone...
回答5:
To list all virtualenvs
conda env list
Output:
# conda environments:
#
D:\Programs\Anaconda3
D:\Programs\Anaconda3\envs\notebook
D:\Programs\Anaconda3\envs\snakes
D:\Programs\Anaconda3\envs\snowflakes
base * D:\Programs\Miniconda3
gluon D:\Programs\Miniconda3\envs\gluon
回答6:
For conda created env use:
conda info --envs or conda info -e or conda env list
For virtualenvwrapper created env use:
lsvirtualenv
回答7:
This works on Windows only:
If you are trying to find all envs created using virtualenv
search for "activate_this.py" or "pip-selfcheck.json"
来源:https://stackoverflow.com/questions/7212140/list-all-virtualenv