4 ms·
why use -m?
by randyrand 4y ago
why use -m?
- viraptor 4y agoIt ensures you're installing into environment using your current python. Useful in case the op already has a messed up environment where default pip doesn't use default python.
- julienpalard 4y agoIt's a good habit which ensures pip runs with the same interpreter as your `python` command. One example (but there's many): On Windows a `pip install --upgrade pip` can't work as the OS would lock the `pip` executable, while a `python -m pip install --upgrade pip` works as the OS would lock python instead. I also encontered environments (CI runners, things like this) with `python` and pip installed, installed but no `pip` shortcut. More: https://snarky.ca/why-you-should-use-python-m-pip/ https://snarky.ca/why-you-should-use-python-m-pip/