Installing a separate copy of Python is a popular option, even though Python already comes with MacOS. You take on the responsibility to make sure you're using the copy of Python you intend. But, the benefits are having the latest Python release and some protection from hosing your system if things go badly wrong.
To install Python using HomeBrew:
brew update
brew install python # or brew install python3
Now confirm that we're working with our newly installed Python:
ls -lh `which python`
...should show a symbolic link to a path with "Cellar" in it like:
lrwxr-xr-x 1 chris admin 35B Dec 2 13:40 /usr/local/bin/python -> ../Cellar/python/2.7.8_2/bin/python
Pip should be installed along with Python. You might want to upgrade it by typing:
pip install --upgrade pip
Now you're ready to install any of the 50,000+ packages on PyPI.
Other Notes
Formerly, I've used get-pip.py to install pip. But, the docs warn that get-pip.py does not coordinate with package managers and may leave your system in an inconsistent state. Anyway, there's no need, given that pip is now included with Python as of 2.7.9.
Note that pip isn't the only package manager for Python. There's also easy_install. It's no good to mix the two, so don't do it.
Finally, if you have both Python 2 and 3 installed, pip will point to whichever Python you installed last. Get in the habit of explicitly using either pip2 or pip3, so you're sure which Python is getting the new library.
Happy hacking!