pythonmacospython-2.7homebrewmacos-monterey

How to install Python 2 on macOS 12.3+


macOS 12.3 update drops Python 2 and replaces it with version 3:

https://developer.apple.com/documentation/macos-release-notes/macos-12_3-release-notes

Python Deprecations Python 2.7 was removed from macOS in this update. Developers should use Python 3 or an alternative language instead. (39795874)

I understand we need to migrate to version 3, but in the meantime we still need version 2. Homebrew does not seem to have it anymore:

brew install python@2.7
Warning: No available formula with the name "python@2.7". Did you mean python@3.7, python@3.9, python@3.8, python@3.10 or python-yq?

brew install python2
Warning: No available formula with the name "python2". Did you mean ipython, bpython, jython or cython?

What gives?


Solution

  • You can get any Python release, including the last Python 2, from the official download site:

    https://www.python.org/downloads/release/python-2718/macOS 64-bit installer