Install python3 from Homebrew vs the installer from https://www.python.org/

homebrewpython

Is there any advantage of installing python 3 through homebrew vs through the installer from https://www.python.org/ or vice verse (except that the installer can give me the latest version)?

I try both and I can't find the difference.

—- update —-

I now gain some insights about this question.

  1. If I install python through the installer, the installer will modify PATH in .zprofile like following and create softlink /usr/local/bin/python3
    # Setting PATH for Python 3.8
    # The original version is saved in .zprofile.pysave
    PATH="/Library/Frameworks/Python.framework/Versions/3.8/bin:${PATH}"
    export PATH
    
    # Setting PATH for Python 3.9
    # The original version is saved in .zprofile.pysave
    PATH="/Library/Frameworks/Python.framework/Versions/3.9/bin:${PATH}"
    export PATH

    ls -al /usr/local/bin/python3                             
    lrwxr-xr-x  1 root  wheel  69 11 20 11:18 /usr/local/bin/python3 -> 
    ../../../Library/Frameworks/Python.framework/Versions/3.9/bin/python3
  1. if I then install python thru brew, brew will complain. Sometimes I don't run brew install python directly but install some bottle, which installs python, e.g brew install httpie will install python, then brew complains
    ...
    ==> Caveats
    Python has been installed as
      /usr/local/bin/python3
    
    Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
    `python3`, `python3-config`, `pip3` etc., respectively, have been installed into
      /usr/local/opt/python@3.9/libexec/bin
  1. macOS preinstall python at /usr/bin/python & /usr/bin/python3 which remain unchanged. But since PATH is modified by the installer or brew (brew puts /usr/local/bin before /usr/bin) so preinstall python is shadowed.

  2. I do find brew has an "annoying" feature, when brew’s Python being installed as a dependency for a bottle and then I uninstall the bottle, the brew's Python remains. For example I installed httpie and uninstalled it. But to my surprise my system python is still the one installed by httpie. It took me quite sometimes to figure out that.

Best Answer

I'd say it's entirely a matter of personal preference, as to whether you like to use HomeBrew or not.

There was a recent post about some problem with brew python, but it may be a local issue, or have been fixed. Python 3 'json' module is actually corrupted