How do I find the name of the conda environment in which my code is running?

Use the Terminal or an Anaconda Prompt for the following steps.

By default, the active environment—the one you are currently using—is shown in parentheses () or brackets [] at the beginning of your command prompt:

(myenv) $

If you do not see this, run:

conda info --envs

In the environments list that displays, your current environment is highlighted with an asterisk (*).

By default, the command prompt is set to show the name of the active environment. To disable this option:

conda config --set changeps1 false

To re-enable this option:

conda config --set changeps1 true