Remove Python 2.7 from Mac OS X El Capitan

I want to completely reinstall Python 2, but not one of the manuals we found allows me to remove it. No matter what I do, python --version still returns 2.7.10, even after running the Python 2.7.11 installer. All the other manuals in StackOverflow tell me to delete a bunch of files, but python still exists.

+5
source share
3 answers

It may be a little late, but for future search engines, I will still send:

I wanted to do the same. But I came across this paragraph in Foundation ( Getting and Removing MacPython ), which convinced me to leave myself alone and not delete it.

The Apple-built Python assembly is installed in /System/Library/Frameworks/Python.framework and / usr / bin / python, respectively. You should never modify or delete them, as they are controlled by Apple and are used by Apple software or third-party software. Remember that if you decide to install a newer version of Python from python.org, you will have two different but functional Python installations on your computer, so it is important that your paths and customs match what you want to do.

+12
source

Set your alias to use the python version that you want to use from your .bashrc (or zsh if you use it).

Like: alias python='/usr/bin/python3.4'

+1
source

Accept the accepted answer that uninstalling is a bad idea, but for those who use HomeBrew to install their own Python, you don't need an alias, as in @Mat Marsiglio's answer. Rather, you can do what the HomeBrew installation offers:

 export PATH="/usr/local/opt/python/libexec/bin:$PATH" 

This gives brew the priority of python over the built-in in / usr / bin / python

0
source

Source: https://habr.com/ru/post/1244836/


All Articles