MacOS – How to property uninstall Python 3.7

macospython

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?

Best Answer

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.