15

I want to move to python 3.0 and therefore remove the default python 2.7 (2.6,2.5...) installation on my mac. Including all the installed packages, $PATH,...

Does the python installer from python.org oder MacPorts installer provide an uninstaller, or is there a way to do this manually?

4
  • 5
    Removing any pythons that came with the OS is a bad idea, as all sorts of system utilities depend on them. The python.org and MacPorts python installations do not conflict with the system pythons, so you can use them without fear. If you want to use MacPorts, just put /opt/local/bin and /opt/local/sbin at the very beginning of your $PATH declaration, and you'll be all set. Commented Mar 17, 2013 at 0:39
  • But if I type python ... in a shell, which python is used? Commented Mar 17, 2013 at 0:42
  • see my edited comment above... Commented Mar 17, 2013 at 0:42
  • You can check with which python Commented Oct 4, 2018 at 14:10

1 Answer 1

39

That's a COMPLETELY TERRIBLE idea, and you should never do that. You're likely to break dependencies and requirements for various software that expect to find the default Python in the default location.

Install your choice of Python 3 ( MacPorts, Python.org, whatever ). Update your local $PATH variables to use that Python / PythonPath.

If you don't trust my opinion, here's what official Python.org docs say:

http://docs.python.org/2/using/mac.html

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

Sign up to request clarification or add additional context in comments.

3 Comments

Also, if you install a Python 3 from a python.org installer or with MacPorts, that Python instance will be accessible as python3 or python3.3 (for Python 3.3). It will not use python which is currently reserved for Python 2 versions (by those distributions). Just to be clear, use the latest release of Python 3, currently 3.3.0. In particular, do not use Python 3.0.x which has been retired.
What if you find this port after removing python from /usr/bin/python?
If you removed /usr/bin/python I would probably reinstall the macOS (though I would be tempted to just copy back the binary and Python files from someone with the same machine+os combo).

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.