import sysconfig import sys # Returns false, but is true print(sysconfig.is_python_build()) # PROJECT_BASE seems wrong as it is printing more like INSTALL PREFIX print(sysconfig._PROJECT_BASE) sysconfig.is_python_build(True) print('SYS HOME =>',sys._home) # Hack - set PROJECT_BASE to folder where I build this. sysconfig._PROJECT_BASE='/home/anand/code/cpython/' print('after hack') print(sysconfig.is_python_build())