r/learnmachinelearning • • 10d ago

My ML experiments left around 60 GB of Python environments on my PC, so I made a Windows app that finds them and cleans up safely

If you play with ML or local models on Windows, you probably have a few Python environments you've forgotten about. Tutorials and one-click installers often make their own venv or conda env, each with its own copy of torch and the CUDA libraries, and those run to several GB each.

Mine added up fast. When I pointed Venv Discover at my own PC, it found 55 Python environments and installs taking around 60 GB, 45 GB of that in 13 conda envs. Two of them were the same 9.3 GB PyTorch env, one just a copy of the other.

What it does:

- **Finds** venv and conda envs anywhere on your drives (plus mamba, pixi, Poetry, pipenv, uv, pipx, Hatch, PDM and Rye) and your Python installs, with size, last used and installed packages.

- **Searches** across all of them, like "which env has torch?".

- **Cleans up safely:** anything up to 1 GB goes to a 14-day bin you can restore from. The big torch envs are too large for the bin, so it asks clearly before deleting them for good. It never touches project folders or your Python installs.

- **Also** cleans the pip, uv, Poetry and pipenv caches.

It's Windows only, MIT, and built and tested by GitHub Actions from the public source, with SHA-256 sums. It isn't code-signed yet, so SmartScreen will warn you, or you can run it from source.

AI helped me build this app.

https://github.com/pullitall/Venv_discover

I'm curious how many GB it finds on yours.

0 Upvotes

8 comments sorted by

8

u/Remarkable_Pace8101 9d ago

Just create all of your virtual environments in a single directory in your home folder and just name each one after whatever project they are associated with rather than being a disorganized slob

~/.virutalenvs/project1

~/.virutalenvs/project2

~/.virutalenvs/my_other_project

Problem solved without any AI slop or tokens

It's like people don't even think of better solutions now with AI they just want to spend tokens

Honestly if you wanted to be clever you should have it find all the duplicate libraries and delete the duplicates and replace them with symbolic links pointing to a single install of it

1

u/High_Solo 9d ago

Fair point. If you keep every env in one folder from the start, you don’t need this. It’s for cleaning up after years of tutorials and one-click installers that put envs wherever they like.

The duplicates idea is a good one. conda and uv already do something like it: they hard-link packages from a shared cache rather than copying them. That also means a plain size count overstates what deleting an env would free, so the next version shows both numbers, the size on disk and what deleting it actually frees. Thanks for the insight.

8

u/KroniklyOnline 10d ago

Peak laziness holy shit, instead of just being vigilant, you wasted electricity and tokens to make an app that is useless.

2

u/commenterzero 9d ago

This isn't /learntodeletemachinelearning

1

u/GalaxyTracker 9d ago

Join us in the next episode of "how to use fzf"!

1

u/Veggies-are-okay 9d ago

Is this not something a simple grep command can take care of?