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

2

u/[deleted] Jul 21 '22

I thought using pip as a module was discouraged?

As noted previously, pip is a command line program. While it is implemented in Python, and so is available from your Python code via import pip, you must not use pip’s internal APIs in this way. There are a number of reasons for this: ...


Ignoring that this text is written against using pip in python which isn't really what's meant by doing -m pip I still think this is silly.

Understand your environment and you won't have a problem. This approach is sort of the result of an X-Y problem.