List all virtualenv

2019-01-21 05:01发布

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.

4条回答
叼着烟拽天下
2楼-- · 2019-01-21 05:36

To list all the virtual environments (if using the anaconda distribution):

conda info --envs

Hope my answer helps someone...

查看更多
戒情不戒烟
3楼-- · 2019-01-21 05:38

Run workon with no argument to list available environments.

查看更多
我想做一个坏孩纸
4楼-- · 2019-01-21 05:42

Silly question. Found that there's a

lsvirtualenv

command which lists all existing virtualenv.

查看更多
欢心
5楼-- · 2019-01-21 06:01

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".

查看更多
登录 后发表回答