Project handoffs and troubleshooting often start by confirming which Conda environments exist and which one the current terminal is using. The environment list shows each registered prefix, which separates the shared base install from named project environments and path-based environments before activation, export, removal, or repair work begins.
conda env list is the environment-focused command, and current Conda treats it as an alias for conda info –envs. Both commands print the same table of known environments and mark the active environment with an asterisk when the current shell has one selected.
The name column is blank for prefix environments created at a path rather than under Conda's named environment directory. Use the path shown in the right column with --prefix or conda activate /path/to/env when that blank row is the environment you need.
Related: How to create a Conda environment
Related: How to activate a Conda environment
Related: How to check Conda environment health
Steps to list Anaconda environments:
- Open a terminal where Conda is available.
- List the registered Conda environments.
$ conda env list # conda environments: # # * -> active # + -> frozen base /opt/conda analytics * /opt/conda/envs/analytics /tmp/project-envThe asterisk marks the active environment. A blank name with a path, such as /tmp/project-env, is a prefix environment rather than a named environment.
- Run the equivalent conda info environment view when a runbook already uses conda info.
$ conda info --envs # conda environments: # # * -> active # + -> frozen base /opt/conda analytics * /opt/conda/envs/analytics /tmp/project-envconda env list and conda info –envs should show the same environment table. If the target environment is missing, create it first or verify that its prefix is registered.
Related: How to create a Conda environment - Use the listed name or path for the next environment command.
$ conda activate analytics (analytics) $
Use the name, such as analytics, for named environments. Use the full path with conda activate or --prefix for path-based environments.
Related: How to activate a Conda environment - Print environment paths as JSON when another tool needs machine-readable output.
$ conda env list --json { "envs": [ "/opt/conda", "/opt/conda/envs/analytics", "/tmp/project-env" ], "envs_details": { ##### snipped ##### "/opt/conda/envs/analytics": { "name": "analytics", "active": true, "base": false, "frozen": false, "writable": true } ##### snipped ##### } }The envs array provides the environment paths for scripts. Current Conda may also include envs_details metadata such as active, base, frozen, and writable.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.