3 ms·
That's an easy question to answer. python -m pip is often advised over pip or /usr/bin/pip, because it uses the version of pip associated with that particular
by coldtea 6y ago
That's an easy question to answer.
python -m pip is often advised over pip or /usr/bin/pip, because it uses the version of pip associated with that particular major+minor python install.
https://snarky.ca/why-you-should-use-python-m-pip/ https://snarky.ca/why-you-should-use-python-m-pip/
- travisoneill1 6y agoWait, but isn't the point of the article that it will not do that, and rather just run the pip.py in you current working directory?
- Sebb767 6y agoOnly in the (probably unlikely) case that you have a `pip.py` in your CWD. In all other cases, it will execute pip as intended.
- BiteCode_dev 6y agoEven with the other form, if pip imports anything named like a pyhon module in the dl dir, it will be imported. That's because the current dir is automatically added to the PATH, using -m only add pip.py to the attack surface.
- coldtea 6y agoIn the off chance that you have one, yes. But in 99.9999999% of cases it will do what you expect (whereas "pip install x" will be easier to use the wrong one if you have multiple Python versions).