r/Python • • Jul 21 '22

Resource Why you should use `python -m pip`

https://snarky.ca/why-you-should-use-python-m-pip/
0 Upvotes

16 comments sorted by

View all comments

11

u/benefit_of_mrkite Jul 21 '22 edited Jul 21 '22

I never use -m because I use virtual environments.

While in a venv, -m is pointless because I know python in that instance is the one in the venv while the venv is active.

So while I agree with this in principle I disagree with it in practice.

If you’re not using venvs you can absolutely hose your system python with dependencies.

And if you used to not use venvs but decide to later, implementing a new venv copies over every single package you ever installed as well as the python binary and other files.