npm for package management.
pip is also the CLI command that you will use to interact with pip, and there are many variants.
> pip install pandas > pip2 install pandas > pip3 install pandas
The thing to note here is that
pip3 operates on a
Python3 environment only, as
pip2 does with
pip (w/o the 2 or 3) operates contextually. For example, if you are in a
Python3 virtual environment,
pip will operate on the
Yes that's correct. Let's say I have two versions of Python installed, like Python 3.7 and 3.8. Now, if you were to type pip or pip3 in your terminal, it's not very clear which Python interpreter gets involved.
And this is why you'll see many developers use
python -m pip.
python -m pip executes pip using the Python interpreter you specified as
python. Here you can provide the full path to the interpreter like:
/usr/bin/python3.7 -m pip instead of relying on an alias.