Reputation: 51
I have a question regarding conda environments. Whenever I try to remove an environment in command prompt with conda env remove -n envname
, the actual folder remains in the environments folder. Thus, if I try to recreate the environment with the same name, command prompt gives me an error saying that a folder already exists there and whether or not I would like to proceed.
$ conda create --name test
WARNING: A directory already exists at the target location 'C:\...\Anaconda3\envs\test'
but it is not a conda environment.
Continue creating environment (y/[n])?
I'm not sure whether that is safe, so at this point I manually delete the folder. Is this something that is viable? Is leaving the folder there normal conda behavior? Is there a solution to allow conda to just automatically delete the folder?
Thanks so much!
Upvotes: 5
Views: 5569
Reputation: 437
Ok, I think I figured out the issue. Before you try to remove the env, make sure that:
conda deactivate
to deactivate the env you're about to remove.If the env (or maybe more correctly, the folders where it was stored) are still referenced by a running process or you haven't deactivated the env, conda env remove
will act like it's removing the env and it won't show up in conda env list
, but it will still be possible to activate it and the folders will remain.
Upvotes: 3