1

macOS comes with Python 2 installed, which is presumably because some tools the OS uses are not compatible with Python 3, as suggested by the answers to this Quora question.

Which tools/programs pre-installed with macOS specifically depend on Python 2 over Python 3?

closed as too broad by bmike Jun 20 at 17:02

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Hey there! This is broad according to me. Can you narrow it down by adding say, your necessity or specific category of apps. – ankiiiiiii Jun 20 at 13:17
  • @ankiiiiiii I can’t really narrow it down, I’m afraid – I’m asking out of curiosity rather than any specific need. I’m wondering which tools/programs are preventing Apple from shipping macOS with Python 3 as the default Python. – Noel Jun 20 at 13:20
  • Official EOL for 2.X is 2020, if that helps. – FiddleDeDee Jun 20 at 13:34
2

As well as xattr, other scripts in /usr/bin/ are smtpd.py and systriage.

A number of Automator actions for working with PDFs have at their heart python scripts -- the ones for combining PDFs, watermarking PDFs, extracting pages and converting images.

Quite a few scripts in Server.app are python.

It's not so much that they're definitively "not compatible" with python3, but that they've not been updated for over 10 years and haven't been tested. The scripts have not been updated to ensure that they will continue to work when called in other scripts and workflows.

Catalina will be the last version to include python 2.7, and it does so purely to ensure that these 'legacy' scripts will continue to work without any extra effort.

  • Do you know of any lists anywhere else on the internet, official or not? How did you know these programs depend on python 2? – Noel Jun 20 at 15:54
  • The scripts in the Automator actions are often referenced online, and I came across them while teaching myself how to script CoreGraphics with python. You can also perform a simple search script to find all .py files on your computer. I just did a grep search for the results of file /usr/bin/*, to include the word python. – benwiggy Jun 20 at 15:59
  • Awesome, thanks for the explanation. – Noel Jun 22 at 20:49
0

xattr is the only tool that I can think of.

file /usr/bin/xattr*
/usr/bin/xattr:     Python script, ASCII text executable
/usr/bin/xattr-2.6: a /System/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Py script, ASCII text executable
/usr/bin/xattr-2.7: a /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Py script, ASCII text executable

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