How to list all python virtual environments in Linux?

How to list all python virtual environments in Linux?

If only using the lowly virtualenv ...{directory} to create a virtualenv, then there is just some directory somewhere that has that specific environment in it. You can only list these by running find on your $HOME directory (or any other list of directories you might have used to create virtualenvs) looking for python installations. Hopefully some convention was followed like storing them all in ~/virtualenvs. (See also Where should virtualenvs be created? )

If using virtualenvwrapper, then as mentioned, use the command lsvirtualenv to list envs that were created with mkvirtualenv. They are all in ~/.virtualenvs by default. See https://virtualenvwrapper.readthedocs.io/en/latest/command_ref.html

If using conda, you can list virtual envs created via conda create --name {my_env} [...], using either conda info --envs or conda env list. See https://conda.io/docs/using/envs.html#list-all-environments

How to list all python virtual environments in Linux?

Leave a Reply

Your email address will not be published.