Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conda - unable to completely delete environment

Tags:

python

conda

I am using Windows 10 (all commands run as administrator). I created an environment called myenv. Then I used

conda env remove -n myenv

Now, if I try

conda info --envs

I only see the base environment. However, if I try

conda activate myenv

I'm still able to activate it! I think because under the folder envs, there is still a folder with the name myenv there which doesn't get deleted.

How do I delete the environment for good?

like image 260
user1936752 Avatar asked Oct 16 '22 09:10

user1936752


1 Answers

Command-line options can only go so far, unless you get very specific; perhaps the simplest approach is to delete things manually:

  1. Locate Anaconda folder; I'll use "D:\Anaconda\"
  2. In envs, delete environment of interest: "D:\Anaconda\envs\myenv"

Are you done? Not quite; even while in myenv, conda will still sometimes install packages to the base environment, in "D:\Anaconda\pkgs\"; thus, to clean traces of myenv,

  1. Delete packages installed to myenv that ended up in "D:\Anaconda\pkgs\"

  2. (If above don't suffice) Anaconda Navigator -> Environments -> myenv -> Remove

  3. (If above don't suffice) Likely corrupted Anaconda; make note of installed packages, completely uninstall Anaconda, reinstall.

Note: step 3 is redundant for the goal of simply removing myenv, but it's recommended to minimize future package conflicts.

like image 173
OverLordGoldDragon Avatar answered Oct 19 '22 11:10

OverLordGoldDragon