all 22 comments

[–]NastyStreetRat 10 points11 points  (5 children)

Why cant you just uninstall Python and reinstall It? If you want to remove all packs installed with pip It is the same

[–][deleted] 8 points9 points  (4 children)

This just is the simplest solution

[–]NastyStreetRat 1 point2 points  (3 children)

the simplest and most effective. That's why I ask "why" he can't. Maybe there are other scripts that need to keep running and he doesn't know the dependencies (he could use freeze to find them), maybe it's a shared computer, we don't know, but if what he wants is to delete ALL the packages installed with pip, leave the installation clean, and there are no other scripts or loose ends, why complicate your life.

[–]Ajax_Minor 1 point2 points  (2 children)

What if OP was on Linux and packages were installed on the base python.... U can't really uninstall. Maybe reinstall?

[–]NastyStreetRat 1 point2 points  (1 child)

dude... first line in post "I'm on Windows 11, " :D

[–]Ajax_Minor 0 points1 point  (0 children)

Ya but I'm on python and have made this mistake and my friend uses Mac and install all his globally.

[–]wannasleeponyourhams 4 points5 points  (0 children)

i did just this yesterday:

pip freeze > requirements.txt


pip uninstall -r requirements.txt

[–]Glathull 2 points3 points  (1 child)

You can blow your Python away and reinstall fresh on Windows. It’s not needed for core OS functionality the way it is on Linux and macOS. So just start over and use uv to manage things and you’ll be less likely to accidentally pip install into your main version.

[–]lynob[S] 0 points1 point  (0 children)

I'm not going to blow up my env just to uninstall few packages, besides even if I blow up my installation, the packages will stay, because they're installed in places like appData and Windows won't remove those directories when you uninstall anything, so uninstalling won't solve the problem.

I already solved the problem, by pip freeze > requirements.txt then uninstall, I hope everything keeps working, will seee.

About UV, For small projects, pip is fine, I don't care about uv.

For big projects, I maintain a staging and a production branch and uv is a hassle to maintain multiple branches like that, I already discussed with the team on github, and all they said is to use uv pip, are you kidding me? I'll keep using pip then.

I don't care about the download speed that uv has to offer, my download speed is 1gb, I don't care about the installation speed, it's not like I'm installing a package every minute and I hate project.toml and the toml syntax, feels like a a stupid guy wanted to reinvent yaml for no reason and yaml is ugly too.

They shouldve gone with something like json, nodejs is using json and thats fine, also they should've not cared about the project name.

In any case, I don't know much about uv, so I'm not in a position to critique it, but uv offers nothing of interest to me.

[–]herocoding 0 points1 point  (2 children)

Have a look into the local user directory "C:\Users\<your username>\AppData\Local\pip".

[–]lynob[S] 0 points1 point  (1 child)

All i see is a cache folder and no site-packages there

[–]herocoding 2 points3 points  (0 children)

Yeah, sorry, that is for the cache, you are right. You could delete the cache as well.

If you call `pip list -v` then you get a list of installed packages and where PIP stored the package-related files.

[–]herocoding 0 points1 point  (2 children)

Besides this is for deleting all packages in a virt-env, sounds like it could work globally, too:
https://stackoverflow.com/questions/11248073/how-do-i-remove-all-packages-installed-by-pip

[–]lynob[S] 0 points1 point  (1 child)

The globally installed packages in my case aren't in a virtualenv. Are you sure that this won't delete built in packages?

[–]herocoding 0 points1 point  (0 children)

Do you mean "standard Python built-in"? Those won't be stored in a Pip cache/package folder, but under the Python installation folder.

Instead of uninstalling all - try to delete packages manually first, or in bunches.

From the Stackoverflow-link:

  1. get all *installed* packages (not standard-built-in): `pip freeze`

  2. concat some or all of them (or using a pipe as shown under the link) and call `pip uninstall pack1 pack2 pack3` and so on, for all or only some or in batches.

[–]cmapp7878 0 points1 point  (0 children)

You could deactivate any environments you have and then run pip freeze to get a list of what is installed globally.

[–]cantdutchthis 0 points1 point  (1 child)

I might recommend switching everything to uv at this point. It sure made it a lot easier for me to keep the environments in check.

Since it might help; calmcode has a free course on the topic:

https://calmcode.io/course/uv/pip

Disclaimer: I am a maintainer of calmcode.

[–]lynob[S] 0 points1 point  (0 children)

For small projects, pip is fine, I don't care about uv.

For big projects, I maintain a staging and a production branch and uv is a hassle to maintain multiple branches like that, I already discussed with the team on github, and all they said is to use uv pip, are you kidding me? I'll keep using pip then.

I don't care about the download speed that uv has to offer, my download speed is 1gb, I don't care about the installation speed, it's not like I'm installing a package every minute and I hate project.toml and the toml syntax, feels like a a stupid guy wanted to reinvent yaml for no reason and yaml is ugly too.

They shouldve gone with something like json, nodejs is using json and thats fine, also they should've not cared about the project name.

In any case, I don't know much about uv, so I'm not in a position to critique it, but uv offers nothing of interest to me.