WARNING: A directory already exists at the target location '...' but it is not a conda environment. Continue creating environment (y/[n])?

Viewed 4856

I removed a Conda environment with this line

conda env remove -n myenv

And tried to replace it by creating a new one

conda create -n myenv

And it get this warning:

WARNING: A directory already exists at the target location '...' but it is not a conda environment. Continue creating environment (y/[n])?

It seems like the first command doesn't remove the folder of the environment, even though the environment is deleted.

When removing an environment, is there a way to delete the folder so this warning doesn't pop up?

1 Answers

If you open up an Anaconda Prompt and type in conda info You should see a section that has envs directories and if you go to the first file path specified under "envs directories" in your file explorer, you should see a list of the conda virtual environments you've created, with a directory for each venv. For example, my file path to find it is C:\Users<myusername>\anaconda3\envs

From there, you should be able to find the directory that corresponds to the old virtual environment, and delete it.

Related