I'm trying to build a package but would like to uninstall Python 3.7 from my machine first. The build appears to think /usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/Python exists on my machine, but it doesn't. I wonder if some process is still linked to 3.7 even when it doesn't exist. Anyone know how to property unlink/uninstall Python 3.7?

  • How did you install python 3.7? – mmmmmm Aug 16 '19 at 10:04
  • @Mark I'm afraid I don't remember... Possibly by brew, but I've already uninstalled Python with brew. – John M. Aug 16 '19 at 11:37
  • WHat is the build system? – mmmmmm Aug 16 '19 at 12:04
  • @Mark You mean my cmake version? It's 3.15.2. – John M. Aug 16 '19 at 18:11

I had to do this; I used:

sudo find / -name '*3.7*' 2>/dev/null | grep -e '[Pp]y' | xargs sudo ls -lad

I pipe stderr to /dev/null to eliminate internal files that even with sudo I can't access. Things like:

find: /private/var/folders/zz/zyxvpxvq6csfxvn_n00000sm00006d/0: Operation not permitted

That returned all the possible Python 3.7 files / folders / symlinks on the machine. Armed with that, I can remove those files.

Pity that brew may have left something around. That does happen - I just spent 40 minutes getting VirtualBox manually deinstalled / reinstalled up to 6.01 because something in the uninstall file prevented brew from cleaning the existing installation up.

| improve this answer | |
  • ewport those errors to Hombrew so they get fixed – mmmmmm Aug 16 '19 at 21:32

You must log in to answer this question.

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