How do I remove unnecessary python packages? At global and in vnev?

https://lemmy.world/post/1182075

How do I remove unnecessary python packages? At global and in vnev? - Lemmy.world

As an alternative to having to clean your Python environments, I’d like to suggest putting those efforts into mastering Docker. If you can master using Docker containers as your Python environment, you can cut through a lot of the pains regarding dealing with virtual environments, multiple Python installations, and the quasi-confusing PYTHONPATH environment variable.

I don’t even install Python on my machines anymore. I’m 100% “dockerized” and I’ll never go back.

This works great, assuming you’re using Linux. On Windows this kind of a setup is a nightmare to maintain, since if something goes wrong you have to troubleshoot through several layers of virtualization and weird OS integrations to understand what’s happening. Venv is a much better solution for that.

Yeah, my experience with docker on windows has been pretty bad, uses high CPU and RAM at the best of times, at the worst completely hangs my computer on 100% CPU usage forcing a restart as the only fix.

I really don’t understand why people are overcomplicating this. You can install multiple Python versions at once on Windows and it just works fine (you can use the py command to select the one you want).

Virtual environments are designed exactly for this use case. They’ve got integrations for pretty much everything, they’re easy to delete/recreate, they’re really simple to use, they’re fast, and they just work.

If virtual environments alone aren’t quite enough you can use something like poetry or pipenv or the many other package management options, but in many cases even that is overkill.

That matches my experience as well. Nothing kills a developers motivation like spending time dealing with bullshit on their dev environments as opposed to actually working on the things they care about.