12

I initially thought that this would happen with Catalina, but since it didn't happen a similar question is again relevant:

My question is two fold:

  • When I eventually update to macOS Big Sur, will the Python (2.7.X) installation – which currently ships with macOS – get removed from my system?
  • What about if I do a fresh install; will python be gone then?

Relevant section from macOS Catalina 10.15 Release Notes (emphasis mine):

Scripting Language Runtimes

Deprecations

  • Scripting language runtimes such as Python, Ruby, and Perl are included in macOS for compatibility with legacy software. Future versions of macOS won’t include scripting language runtimes by default, and might require you to install additional packages. If your software depends on scripting languages, it’s recommended that you bundle the runtime within the app. (49764202)
  • Use of Python 2.7 isn’t recommended as this version is included in macOS for compatibility with legacy software. Future versions of macOS won’t include Python 2.7. Instead, it’s recommended that you run python3 from within Terminal. (51097165)

Source: https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes

I can't find anything about this in Big Sur's release notes though.

Edit: I am not actively using Python 2, I'm simply wondering this since it might affect some 3rd party software which relies on the OS's Python installation.

0

5 Answers 5

22

No, on Apple Macs being shipped with Big Sur, Python 2 and Python 3 are both still included.

$ which python
/usr/bin/python

$ python --version
Python 2.7.16

$ which python3
/usr/bin/python3

$ python3 --version
Python 3.8.2

This is on an M1 Mac mini running macOS Version 11.0.1.

3
  • 2
    Wait, I didn't realize python3 was ever included by default. Is that a recent addition? Nov 23, 2020 at 14:54
  • 2
    It seems like Xcode uses it. news.ycombinator.com/item?id=25137939
    – van
    Nov 27, 2020 at 19:33
  • 8
    On 11.1 python3 is not included, just a stub telling you to install Xcode. Xcode gives python 3.8
    – mmmmmm
    Jan 20, 2021 at 11:54
9

No, it didn't get removed in Catalina, nor in Big Sur, and not even on the initial release of Monterey, but finally in macOS Monterey 12.3 it does get removed: https://developer.apple.com/documentation/macos-release-notes/macos-12_3-release-notes#Python

Update: @Bemipefe confirmed that python did get removed even when just upgrading (and not doing a clean install) from macOS 12.2 to 12.3.

3
  • If I understood correctly you are saying that any software which was using the embedded python runtime won't work anymore on a fresh install of macOS Monteray 12.3. Correct ?
    – Bemipefe
    Feb 17 at 8:55
  • I cannot confirm that. I haven't installed 12.3 beta so I'm not 100% sure whether it will actually delete the existing /usr/bin/python or whether it will just stop shipping it with fresh installs.
    – ruohola
    Feb 17 at 9:09
  • 3
    I just installed the beta of Monteray 12.3 (upgrade from 12.2) and I can confirm that unfortunately python has been removed. If you type python in the command line the result is command not found. If you type python3 a pop-up is displayed asking you to install the developer tools.
    – Bemipefe
    Feb 17 at 10:10
5

Python 2.7 is still present on my system despite the fact that I have never installed it myself so I think that it is safe to assume that it is still present for this year.

However I, like your computer, will recommend that you switch to Python 3 if at all possible because Python 2 is only included in macOS for compatibility with legacy software and is no longer being updated/supported by the Python Software Foundation.

Edit: I know that this isn't about Big Sur anymore, but MacOS Monterey version 12.3 is removing the default python 2.7 installation. I just installed the beta and no longer have python 2 :)

1
  • 1
    I strongly support the notion that people should really, really wean themselves off from Python 2. It has officially been "sunsetted" as of 2020-01-01, see python.org/doc/sunset-python-2 .Now unfortunately OS-es still rely on some Python2 scripts, but end-users must avoid that. Jun 30, 2021 at 10:12
4

Several parts of the OS rely on python2 scripts that Apple haven't updated yet. So the 'for legacy purposes' is as much for Apple as any third-party scripts you might be running.

python2 scripts are used for several of the Automator actions for PDF manipulation, and the xattr command, among other things.

Interestingly, python v2 in Big Sur is a Universal Binary, so has been compiled for Apple Silicon.

python3 is included as part of Xcode Command Line Tools: there is a little stub python3 command that tells you that you need to install Xcode (Command Line Tools) to run python3.

1
  • Ok, thanks. Gonna delete that then...
    – nohillside
    Feb 15, 2021 at 15:58
1

Yes python 2 is installed on your system. A fresh install won't change this. The python-2 is write protected and probably can't be removed. Apple use to run python 2 scripts when starting up. I suppose it still does and hence the write protection.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .