How can one tell if a given instance of Python (on OS X) was compiled with the --enable-framework flag?
The one thing I tried is not entirely conclusive:
% python -c 'import sysconfig, pprint; pprint.pprint(sysconfig.get_config_vars())' | grep -i framework
'LIBS': '-ldl -framework CoreFoundation',
'PYTHONFRAMEWORK': '',
'PYTHONFRAMEWORKDIR': 'no-framework',
'PYTHONFRAMEWORKINSTALLDIR': '',
'PYTHONFRAMEWORKPREFIX': '',
'RESSRCDIR': 'Mac/Resources/framework',
'SHLIBS': '-ldl -framework CoreFoundation',
'WITH_NEXT_FRAMEWORK': 0,
The definitive test for an OS X framework build:
./configure --enable-framework ...
is the presence of PYTHONFRAMEWORK in the Python build config variables. This idiom is used throughout the Python standard library:
if get_config_var("PYTHONFRAMEWORK"):
# framework build
See for example, this test at line 221 in the sysconfig module itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With