Python 2.7 removed from macOS Monterey 12.3
The developer notes for macOS Monterey 12.3 beta contains details of new features and also deprecations.
Python 2.7 was removed from macOS in this update. Developers should use Python 3 or an alternative language instead. (39795874)
I moved to Python 3.x a while back (I use conda python) but if you are relying on system python and are still using version 2.7 this sounds like time to move.