`conda env remove` hangs for 16 hours, what are my options?

Viewed 861

At 5 PM yesterday evening, I executed:

(my_root) C:\Users\W>conda env remove --name py36

Having made no apparent progress overnight, I just killed it at 08:45 AM.

In executing the same command from the same environment (my_root), it took no more than a 5-10 minutes to remove other conda environments earlier yesterday.

Is there a more heavy-handed way to get rid of an environment from within conda or am I left with backing-up the envs I want to yml and doing a complete uninstall/reinstall of conda?

Cheers

2 Answers

On mac/linux you can nuke the directory containing the environment, and it'll remove the environment:

(base) mmessersmith@blah:~$ conda info --envs
# conda environments:
#
base                  *  /home/mmessersmith/miniconda3
py2                      /home/mmessersmith/miniconda3/envs/py2
py36                     /home/mmessersmith/miniconda3/envs/py36

(base) mmessersmith@blah:~$ rm -rf  /home/mmessersmith/miniconda3/envs/py2
(base) mmessersmith@blah:~$ conda info --envs
# conda environments:
#
base                  *  /home/mmessersmith/miniconda3
py36                     /home/mmessersmith/miniconda3/envs/py36

Can't confirm it works on windows ATM, but should (and you don't have too much to lose by trying it if you're debating a full-reinstall anyway).

Cheers for the quick posts...

It seems my problem is indicative of something deeper in my Conda install.

Consulting my install directory for the py36 env (see my reply to @ Mad Physicist above) revealed most of the content was gone (all except \scripts subdir with ~20 files with *.exe.conda_trash extensions).

Exploring other \env subdirs I deleted successfully yesterday (where 'remove' ran to completion) revealed the similar contents to \envs\py36.

>conda env list

confirmed that py36 was no longer available, so I ran

>conda clean --yes --all

which also froze.

But also freed a heap of space on my hard-drive (successfully removed a mess of *.tar.bz2 files).

Conclusions:

  • the original 'remove' seemed to have worked properly and (per @Mad Physicist and @Matt Messersmith) it seems to be OK to just delete the respective Windows subdirs under \envs

  • because the freezing behaviour is a bit of a concern, I'll be doing a full uninstall (after yml backups), then reinstalling

Related