Home > Enterprise >  Removing python from usr/bin on Mac OS
Removing python from usr/bin on Mac OS

Time:10-24

My Python installation was broken, so I wanted to uninstall Python and start over. I thought I had wiped all the Python (minus the installations in Systems), but when I run

which python

I see

/usr/bin/python

I tried just removing the file, but this violates MAC permissions. I could reboot in recovery mode and override, but I'm not sure if I should? Does anyone know if there are problems associated with doing this? Also what exactly is this file?

CodePudding user response:

This file is not meant to be manually removed. You should uninstall Python because you will probably have whole bunch of binaries and libraries that will need to be removed too. Also, this is probably a symlink so you will need to hunt down all files associated with whatever version it is pointing to.

If you have to remove it manually because your installation is so broken then sudo rm /usr/bin/python and a password should work - if by violates MAC permissions you mean the usual permission error rm: cannot remove '/usr/bin/python': Permission denied".

You should not need to boot into recovery mode.

In the future, for all programs that rely on Python, do not run pip with elevated permissions (ideally use a virtual environment). It sounds that this is likely the cause of your problem.

CodePudding user response:

sudo rm -rf /usr/bin/python

Try that.

  • Related