What is the current correct way to install pip on macOS? [closed]

I'm seeing a fair amount of conflicting information on Reddit and Stack Overflow on this topic. I'm a long-time Linux user, just bought my first macOS computer.

For python development, I'm seeing that python is already installed on my Mac. I'm also seeing some posts that say I shouldn't use the pre-installed version and should download the installer from python.org. I'm also seeing some posts saying that I shouldn't use the installer, but instead should use Homebrew to install python2 and python3.

Is there an authoritative source, or somewhere that explains the pros and cons of the different methods? I use pip extensively, is there a method that will cause the least amount of issues with that?

If I were to install python2 and python3 via either of the above two methods, would they replace the system versions of python? If they don't replace the system python, are the brew/installer versions automatically sourced first in my PATH?

Sorry, I know this is a flood of questions, I'm just trying to understand how the OS works regarding installers/brew.


There isn't going to be an "authoritative" source.

The reason people tell you not to use the system python is that it is python 2.7, which is no longer supported by python.org.

There is no problem with having multiple versions of python installed, you should install what you want to use. Unless you do something deliberate, you cannot overwrite the system python, nor should you, parts of the OS still use it.

Apple distributes python 3.7 and python 3.8 as part of the Command Line Tools, and you can install and use that. Use the command line xcode-select --install to install the CLT.

If you choose to install a third-party build, I would recommend installing from python.org, not using homebrew. Homebrew is invasive and makes other changes you may not want.

These will install python 3.x as python3, per PEP394 .

When you use pip3, it will install packages into the library of the python that is running pip3, or into your $HOME if it can't write to site-packages. You should always either use a venv, or install into your $HOME.