See https://github.com/python/cpython/blob/main/Mac/BuildScript/build-installer.py
Starting with Python 3.7, in pyconfig.h, PYTHONFRAMEWORK was renamed to _PYTHONFRAMEWORK . See python/cpython@6b42eb176 (bpo-29585: Fix sysconfig.get_config_var("PYTHONFRAMEWORK") (GH-2483))