Jacob Tomlinson
Home Blog Talks Newsletter About

Cleaning up conda environments

1 minute read #conda, #python, #hygine

Often when I’m developing or debugging in Python I end up creating throw away conda environments. They will be to test some package installation or combination of packages and once I’ve finished I will probably never use them again.

Usually I accidentally leave these hanging around and end up with a cluttered conda env list.

Here’s a quick one liner to remove any environments with the words tmp, temp or test in them.

$ conda env list | grep 'tmp\|temp\|test' | awk '{ print $1 }' | xargs -n1 -d'\n' conda env remove -n

Have thoughts?

I love hearing feedback on my posts. You should head over to Twitter and let me know what you think!

Spotted a mistake? Why not suggest an edit!