1

How can I find all of the different Python(s) installed on my Mac? I've accidentally damaged a copy of Python 3 that was under /usr/local/bin, and want to replace it/fix it, but I don't even know how Python 3 got there in the first place – macOS only ships with 2.7.

Can I use HomeBrew to fix a broken copy?

How can I clean up my Python copies, so that I just have what should be there?

2
  • You ask for conflicting things " I just have what should be there" and Homebrew. Homebrew does not touch system things
    – mmmmmm
    Commented Aug 6, 2017 at 8:11
  • Because I’m talking about all of the python installations I have
    – yeeeeee
    Commented Aug 6, 2017 at 9:09

1 Answer 1

1

You can re-install the python3 that you messed up. With brew install python3 This linked question talks about the command line tools that may be need to complete the install. https://stackoverflow.com/questions/14583427/brew-install-python3-fails

To remove the home-brew versions, so that you only have the system original brew remove python python3 && brew cleanup

5
  • That installs a home brew copy, and doesn’t replace the system one
    – yeeeeee
    Commented Aug 6, 2017 at 7:51
  • /usr/local/non does not contain any system things it is empty on a clean macOS install
    – mmmmmm
    Commented Aug 6, 2017 at 8:11
  • You said "can I use HomeBrew to fix". "Just have what should be there" is ambiguous, do you mean an old-outdated by standard osX system pre-installed version of python. Or a working, shiny-brand new version? Commented Aug 6, 2017 at 8:46
  • I just want to fix the one in /usr/local. I accidentally broke it by deleting one of the files. I was wondering if I could change the directory of homebrew’s install to place into the system version.
    – yeeeeee
    Commented Aug 6, 2017 at 9:10
  • Check the /us/local one by cd /usr/local && open . In Finder right-click get-info on python. You see that it is aliased to /usr/local/Cellar/python3/python3.6.1 . . . . That is the home-brew version that you deleted the file from. "Fix" it with brew reinstall python3 Does which python point to /usr/bin/python. and you want /usr/local/bin/python3 to be the default instead? Then your problem is actually that /usr/bin is before /usr/local/bin in your echo $PATH you need to read up on changing the order of your PATH. Commented Aug 6, 2017 at 9:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .