I\'m looking for a good way to figure out the name of the conda environment I\'m in from within running code or an interactive python instance.
The use-case is that
very simply, you could do
envs = subprocess.check_output('conda env list').splitlines() active_env = list(filter(lambda s: '*' in str(s), envs))[0] env_name = str(active_env).split()[0]