Remove and Reinstall Python on Mac -- Can I trust these old references?

Solution 1:

So, I ended up removing all python installations, and reinstalling things via Homebrew.

  1. which python ---> /Library/Frameworks/Python.framework/Versions/2.7/bin/python Delete the entire Python.framework directory from /Library/Frameworks.
  2. which python3 ---> /usr/local/bin/python3 Delete the entire python3 directory.
  3. I was a bit nervous about the symlinks. I initially renamed the ones that were obviously going to cause me trouble. It turns out that was unnecessary. Instead, just use:

    $ brew doctor
    Warning: Broken symlinks were found. Remove them with 'brew prune':
      /usr/local/bin/python-32
      /usr/local/bin/python2-32
      /usr/local/bin/python2.7-32
      /usr/local/bin/python2_DNU
      /usr/local/bin/python_DNU
      /usr/local/bin/pythonw-32
      /usr/local/bin/pythonw2-32
      /usr/local/bin/pythonw2.7-32
    

    So, brew prune (or brew cleanup --prune in newer versions of Homebrew) worked perfectly. It removed all of the above symlinks.

  4. Reinstall python and python3 via homebrew. All done.

At no time did I touch the python installation located within the /System folder.

Oh, and to be clear. The answer to the original question is

Yes, you can trust the old references, as written! That guidance is still valid.

Solution 2:

My Python version was 3.6, I wanted to upgrade to 3.7 (In case you have similar requirements). I am using macOS version 10.12.6 and simply uninstalling and re-installing worked for me:

brew uninstall --ignore-dependencies python3

Then:

brew install python3

and done:

python3
Python 3.7.2 (default, Jan 13 2019, 12:51:54) 
[Clang 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.