14

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?

WhatIsName
  • 2,294
  • 4
  • 24
  • 36
  • 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. – MattDMo Mar 17 '13 at 00:39
  • But if I type python ... in a shell, which python is used? – WhatIsName Mar 17 '13 at 00:42
  • see my edited comment above... – MattDMo Mar 17 '13 at 00:42
  • You can check with `which python` – floatingpurr Oct 04 '18 at 14:10

1 Answers1

36

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.

Jonathan Vanasco
  • 15,111
  • 10
  • 48
  • 72
  • 4
    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. – Ned Deily Mar 17 '13 at 00:50
  • What if you find this port *after* removing python from `/usr/bin/python`? – Vadorequest Jan 22 '18 at 14:26
  • 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). – Jonathan Vanasco Jan 22 '18 at 17:55