How to deactivate and remove a conda environment
Deactivate a conda environment
-
If your conda environment is activated. Type the following to deactivate it:
conda deactivate <name>
Remove a conda environment
-
Once your conda environment is deactivated, To remove it, type the following:
conda remove -n <name> --all -y
-
If you get a warning message. Ignore it. It will disappear once you start a new job.
-
You should also remove the kernel installation. In the terminal type:
jupyter kernelspec uninstall <name> -y
-
To remove all unused conda packages. In the terminal type:
conda clean --all
-
Start a new job to remove possible cache files.
-
Verify if your
home/<username>/.conda/pkgs
directory still has unwanted packages installed. If it does, repeat step 4.