Question

Environment:

  • Mac OS X 10.8.5
  • Apache 2.2.26
  • Homebrew Python 3.3.3

Problem:

I am trying to install mod_wsgi but first need to determine if Python was configured and compiled with the '--enable-shared' option.

Questions:

  1. How can I determine if Homebrew installed Python with the '--enable-shared' option?
  2. If it was not installed, what is the correct way to install it?

Thank you!

Was it helpful?

Solution

From the python repl:

import sysconfig
sysconfig.get_config_vars('Py_ENABLE_SHARED')

OTHER TIPS

A bit better is to use

import sysconfig
sysconfig.get_config_var('Py_ENABLE_SHARED')

This returns the integer value 0 or 1 directly. The plural form is used to get multiple values or a whole dict if no argument is given, see https://docs.python.org/3/library/sysconfig.html?highlight=get_config_vars#sysconfig.get_config_vars

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top