I had to install Sphinx on Ubuntu for use with python (django) and I came across this two commands: pip install Sphinx
, and then I saw this too python -m pip install Sphinx
.
Are there any difference as to where Sphinx will be installed as I want to be able to use Sphinx globally ?
/usr/bin/pip
is just a Python script that invokes thepip
module using theload_entry_point
function. Therefore, the following are (mostly) equivalent:See What's the difference between pip install and python -m pip install? on Stack Overflow for details.
As long as you don't have multiple versions of python installed, these two commands do the same. You can test this by doing
pip list
andpython -m pip list
it should output the same packages.If you do have multiple versions installed, either keep the preferred one on you path or call it directly with its absolute path i.e.
/usr/bin/python