Skip to content

Dear Internet Explorer user: Your browser is no longer supported

Please switch to a modern browser such as Microsoft Edge, Mozilla Firefox or Google Chrome to view this website's content.

List all Virtual Environments in Python

A simple method exists for identifying all virtual environments that have been created using the virtualenv package in Python.

On the Linux command line, enter the following:

find ~ -type f -name "activate" -exec egrep -l nondestructive /dev/null {} \; 2>/dev/null

This will provide a list of all of the folders that are linked to virtual environments. For example, here is the output on my system:

amdimech@adonline:~$ find ~ -type f -name "activate" -exec egrep -l nondestructive /dev/null {} \; 2>/dev/null
/home/amdimech/PlantCV-4.5.1/bin/activate
/home/amdimech/tensorflow/bin/activate
/home/amdimech/PlantCV-4.0.1/bin/activate

   

Comments

No comments have yet been submitted. Be the first!

Have Your Say

The following HTML is permitted:
<a href="" title=""> <b> <blockquote cite=""> <code> <em> <i> <q cite=""> <strike> <strong>

Comments will be published subject to the Editorial Policy.