I am trying to remove all traces of an environment so that I can set it up again. Unfortunately, conda thinks that the environment is active no matter how many times I type conda deactivate.
I’m using Windows.
Here’s what I have-
(jupyter) H:>conda deactivate
H:>conda remove jupyter --all
CondaEnvironmentError: cannot remove current environment. deactivate and run conda remove again
H:>conda env list
# conda environments:
#
base C:Userst57731AppDataLocalminiforge3
2015052 C:Userst57731AppDataLocalminiforge3envs2015052
2015052-2 C:Userst57731AppDataLocalminiforge3envs2015052-2
2024045 C:Userst57731AppDataLocalminiforge3envs2024045
2024077 C:Userst57731AppDataLocalminiforge3envs2024077
20240xx C:Userst57731AppDataLocalminiforge3envs20240xx
ccds C:Userst57731AppDataLocalminiforge3envsccds
jupyter C:Userst57731AppDataLocalminiforge3envsjupyter
jupyter2 C:Userst57731AppDataLocalminiforge3envsjupyter2
Similarly, switching to a different environment poses the same issue:
H:>conda activate base
(base) H:>conda remove jupyter --all
CondaEnvironmentError: cannot remove current environment. deactivate and run conda remove again
6
The line conda remove jupyter --all
should be conda remove -n jupyter --all
.
The -n
(or --name
) ensures that it’s referencing environment name.