Search code examples
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 [email protected]
Warning: No available formula with the name "[email protected]". Did you mean [email protected], [email protected], [email protected], [email protected] 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