2

I have python 2.7 installed on my macbook pro in /usr/bin. When I do ls python* I see these files: python python-config python2.7 python2.7-config pythonw pythonw2.7.

I want to delete them but I can't find a way to do it, I've tried sudo rm -rf and other things but nothing seems to work.

When I do sudo rm -rf I get this:

rm: python: Operation not permitted,

and when I do sudo rm python I get this

override rwxr-xr-x root/wheel restricted,compressed for python?

I want to delete python entirely from my system , can someone help me?

3 Answers3

-1

Do not remove python 2.7 from your Mac computer. As you have seen you probably can't anyway. The Mac uses python and the files are protected to be sure they are not removed.

If you want to run another version of python install it and set up virtual environments.

Natsfan
  • 4,093
  • 3
  • 22
  • 29
-1

Referenced here

# sudo rm -rf /Library/Frameworks/Python.framework
sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7
sudo rm -rf "/Applications/Python 2.7"
cd /usr/local/bin && \
sudo ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' | awk '{print $9}' | xargs rm
henry74
  • 1,015
  • 1
  • 10
  • 14
-3

Lol can't believe no one has said this:

Boot into recovery, turn off SIP: csrutil disable restart, open terminal cd /usr/bin then sudo chmod -R 777 ./ try it again $ python --version you should no longer see it