Configuration Variables


In [1]:
import sysconfig

config_values = sysconfig.get_config_vars()
print('Found {} configuration settings'.format(
    len(config_values.keys())))

print('\nSome highlights:\n')

print(' Installation prefixes:')
print('  prefix={prefix}'.format(**config_values))
print('  exec_prefix={exec_prefix}'.format(**config_values))

print('\n Version info:')
print('  py_version={py_version}'.format(**config_values))
print('  py_version_short={py_version_short}'.format(
    **config_values))
print('  py_version_nodot={py_version_nodot}'.format(
    **config_values))

print('\n Base directories:')
print('  base={base}'.format(**config_values))
print('  platbase={platbase}'.format(**config_values))
print('  userbase={userbase}'.format(**config_values))
print('  srcdir={srcdir}'.format(**config_values))

print('\n Compiler and linker flags:')
print('  LDFLAGS={LDFLAGS}'.format(**config_values))
print('  BASECFLAGS={BASECFLAGS}'.format(**config_values))
print('  Py_ENABLE_SHARED={Py_ENABLE_SHARED}'.format(
    **config_values))


Found 658 configuration settings

Some highlights:

 Installation prefixes:
  prefix=/Users/gaufung/anaconda
  exec_prefix=/Users/gaufung/anaconda

 Version info:
  py_version=3.6.0
  py_version_short=3.6
  py_version_nodot=36

 Base directories:
  base=/Users/gaufung/anaconda
  platbase=/Users/gaufung/anaconda
  userbase=/Users/gaufung/.local
  srcdir=/Users/gaufung/anaconda/lib/python3.6/config-3.6m-darwin

 Compiler and linker flags:
  LDFLAGS=-L/Users/gaufung/anaconda/lib  -arch x86_64 -L/Users/gaufung/anaconda/lib  -arch x86_64
  BASECFLAGS=-Wno-unused-result -Wsign-compare -Wunreachable-code
  Py_ENABLE_SHARED=1