Description
Current Behavior
On UNIX-family operating systems (Linux and macOS), conda env list
generates a list of all environments belonging to the current user. This behavior changes if conda
is executed with UID 0, in which case conda
attempts to find all user home directories on the system and list all environments belonging to all users.
This is not consistent with the behavior on Windows. On Windows, conda env list
always attempts to find all user home directories on the system, and displays all environments belonging to all users. This occurs whether or not the current user is an administrator.
This behavior is not documented in the Conda user guide, which just says that conda env list
is used "to see a list of all your environments." https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#viewing-a-list-of-your-environments
Steps to Reproduce
On macOS/Linux, this will list the current user's environments only:
conda env list
Running this command with sudo
will list all environments on the system:
sudo conda env list
On Windows, running this command from either a standard prompt or from an administrative prompts with elevated permissions will list all environments on the system (as long as the executing user can read the environment configuration file for the user that actually owns the environment):
conda env list
Expected Behavior
I would expect one of the two following behaviors:
conda env list
only lists the current user's environment on any operating system.conda env list
only lists the current user's environment, unless it is executed as an administrator. This behavior should be consistent between Windows and macOS.
The current behavior on Windows (all users) and macOS/Linux (admins) should only be executed for administrators, if at all. In particular, the current Windows code finds all sibling directories of the current user's home folder and tries to check each one of them for an environment configuration file. In environments where Windows home directories are redirected onto a common network share, this may result in conda env list
firing off a large number of I/O operations as it tries to access all home directories on the network share.