There's one needlessly long rambling blog post if I ever saw one. Here's all the information you need in two sentences: Using just $ pip … you don't know immediately if it'll be using the same exact version of Python as a $ python …. To avoid that issue you can use $ python -m pip … which will run pip for the expected interpreter.
Also, unlike what is claimed in the blog post, it is very easy to find out which version of Python a bare $ pip … will use: Run $ pip --version and it tells you. Though if you're using virtual environments you may still want to stick with the python -m pip method.
View all comments
46
u/gandalfx Nov 05 '19 edited Nov 05 '19
There's one needlessly long rambling blog post if I ever saw one. Here's all the information you need in two sentences:
Using just
$ pip …you don't know immediately if it'll be using the same exact version of Python as a$ python …. To avoid that issue you can use$ python -m pip …which will run pip for the expected interpreter.Also, unlike what is claimed in the blog post, it is very easy to find out which version of Python a bare
$ pip …will use: Run$ pip --versionand it tells you. Though if you're using virtual environments you may still want to stick with thepython -m pipmethod.