The current version of MacOS, 27.2, comes with Python 3.9.6, which was EOL’d a year ago. Has there been any discussion in the PSF to try to get Apple to distribute a supported version of Python, maybe even a relatively current one, in their current OS releases? If so, how did that discussion go? If not, I propose this as a new PSF work item.
I know it’s easy to install recent Pythons with Homebrew; I don’t think that is easy for typical MacOS users who might also want to do some Python programming on their own.
It’s up to Apple to decide which version of Python they want to ship in the OS. I imagine they still patch as needed regardless of core Python’s declaration of EOL status.
The recommendation for MacOS users who want to do some Python programming that goes beyond the most trivial of Python scripts should be that they install their own Python separately from the OS Python. I would say that the same applies to Homebrew Pythons: think of those as being part of Homebrew’s “OS” rather than something for you to use.
There are other ways but you can just download and install Python from here:
I don’t see why that installer is not suitable for a “typical” MacOS user.
Speaking for myself I used to use pyenv but now use uv to install Pythons on both MacOS and Linux and those both work nicely.
Trying to get a hold of anyone at Apple is extremely difficult. If someone knows somebody at Apple that wants to speak to the SC about any concerns they have over what version of Python to ship, I know the SC would happily talk to them. But historically, the Python shipped with macOS is to serve some other app (e.g., it used to be included to generate the cover letter for the Fax app), not for other people to actually use.
Or put another way. I don’t think this is worth anyone’s time and energy to try and change, especially when it’s volunteer time.
Yes, and technically speaking, Python is no longer shipped with macOS, rather it is included as part of Xcode or the Xcode Command Line Tools. Yes, there is a /usr/bin/python3 stub file but trying to use it will trigger the installation of the Command Line Tools if you don’t already them or Xcode installed. This is also the case for a number of other build command line tools. My understanding is the included Python is needed for other components in those build tools, for example, for some parts of LLVM. We include a warning in the Python Documentation Set against trying to use the Xcode-supplied python3.
Recent versions of macOS include a python3 command in /usr/bin/python3 that links to a usually older and incomplete version of Python provided by and for use by the Apple development tools, Xcodeor the Command Line Tools for Xcode. You should never modify or attempt to delete this installation, as it is Apple-controlled and is used by Apple-provided or third-party software. If you choose to install a newer Python version from python.org, you will have two different but functional Python installations on your computer that can co-exist. The default installer options should ensure that its python3 will be used instead of the system python3.
I think Apple has made it clear through their actions that they no longer want to be in the business of supplying open source build tools that they themselves do not depend on and defer to third-party distributors like Homebrew, MacPorts, and Anaconda or upstream projects like what we supply on python.org.
And, just to be clear, I think the best thing Apple could do here would be for them to remove /usr/bin/python3 and have the link to the Xcode python3 be somewhere not included in a user’s default PATH.