Fix Python – Meaning of python -m flag

Question

Asked By – Koustav Chanda

What does -m in python -m pip install <package> mean ?
or while upgrading pip using python -m pip install --upgrade pip. What is difference when just running “pip install “

Now we will see solution for issue: Meaning of python -m flag


Answer

If you type python --help

You get

// More flags above
-m mod : run library module as a script (terminates option list)
// and more flags below

A great many things in a terminal will show you how to use it if you either use command --help or man command

This question is answered By – ggdx

This answer is collected from stackoverflow and reviewed by FixPython community admins, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0