There are a few options to install pip on MacOS:
Option 1: Use Homebrew (recommended)
Homebrew is one of the better package managers for Mac. To install Homebrew, open Terminal and type:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Read more here.
Install pip using Homebrew
Using Homebrew to install python will install the latest Python (Python 3.7 currently), pip, and Setuptools.
brew install python
Option 2: Use easy_install
easy_install is the predecessor to pip, and it comes preinstalled on macOS (along with Python 2). You can use easy_install to install pip for Python 2.
sudo easy_install pip
The command to install pip on Linux will vary based on the distribution you're using (and the package manager). Below I'll list the common package managers.
APT (Advanced Packaging Tool)
sudo apt-get install python-pip
sudo apt-get install python3-pip
sudo pacman -S python2-pip
sudo pacman -S python-pip
sudo yum upgrade python-setuptools sudo yum install python-pip python-wheel
sudo yum install python3 python3-wheel