I am having an issue and it is as such: I cannot install Freeswitch mod_python on a x86_64 machine with CentOS and Python 2.7.3
<<QUOTED TEXT BEGINS HERE>>
making all mod_python
Compiling /usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c...
quiet_libtool: compile: gcc -I/usr/src/freeswitch/libs/curl/include -I/usr/src/freeswitch/src/include -I/usr/src/freeswitch/src/include -I/usr/src/freeswitch/libs/libteletone/src -fPIC -Werror -fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1 -g -ggdb -DHAVE_OPENSSL -g -O2 -Wall -std=c99 -pedantic -Wdeclaration-after-statement -D_GNU_SOURCE -DHAVE_CONFIG_H -c /usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c -fPIC -DPIC -o .libs/mod_python.o
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:35:20: error: Python.h: No such file or directory
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:36:25: error: frameobject.h: No such file or directory
In file included from /usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:47:
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python_extra.h:3: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python_extra.h:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python_extra.h:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python_extra.h:6: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:50: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:72: error: expected specifier-qualifier-list before ‘PyThreadState’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c: In function ‘print_python_error’:
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:84: error: ‘PyObject’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:84: error: (Each undeclared identifier is reported only once
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:84: error: for each function it appears in.)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:84: error: ‘pyType’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:84: error: ‘pyValue’ undeclared (first use in this function)
cc1: warnings being treated as errors
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:84: error: left-hand operand of comma expression has no effect
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:84: error: ‘pyTraceback’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:84: error: left-hand operand of comma expression has no effect
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:84: error: ‘pyString’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:84: error: left-hand operand of comma expression has no effect
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:85: error: ‘pyModule’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:85: error: ‘pyFunction’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:85: error: left-hand operand of comma expression has no effect
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:85: error: ‘pyResult’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:85: error: left-hand operand of comma expression has no effect
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:86: error: ISO C90 forbids mixed declarations and code
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:88: error: ‘PyTracebackObject’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:88: error: ‘pyTB’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:89: error: ISO C90 forbids mixed declarations and code
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:99: error: implicit declaration of function ‘PyErr_Fetch’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:100: error: implicit declaration of function ‘PyErr_NormalizeException’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:106: error: implicit declaration of function ‘PyObject_Str’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:106: error: implicit declaration of function ‘PyString_Check’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:107: error: implicit declaration of function ‘PyString_AsString’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:111: error: implicit declaration of function ‘Py_XDECREF’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:125: error: implicit declaration of function ‘PyTraceBack_Check’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:128: error: implicit declaration of function ‘PyImport_ImportModule’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:131: error: implicit declaration of function ‘PyObject_GetAttrString’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:133: error: implicit declaration of function ‘PyObject_CallObject’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:148: error: expected expression before ‘)’ token
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:162: error: implicit declaration of function ‘PyErr_Restore’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c: In function ‘eval_some_python’:
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:174: error: ‘PyThreadState’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:174: error: ‘tstate’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:175: error: ISO C90 forbids mixed declarations and code
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:179: error: ‘PyObject’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:179: error: ‘module’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:179: error: ‘sp’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:179: error: left-hand operand of comma expression has no effect
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:179: error: ‘stp’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:179: error: left-hand operand of comma expression has no effect
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:179: error: ‘eve’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:179: error: left-hand operand of comma expression has no effect
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:180: error: ‘function’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:181: error: ‘arg’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:182: error: ‘result’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:183: error: ISO C90 forbids mixed declarations and code
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:214: error: implicit declaration of function ‘PyThreadState_New’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:214: error: ‘mainThreadState’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:222: error: ‘struct switch_py_thread’ has no member named ‘tstate’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:225: error: implicit declaration of function ‘PyEval_AcquireThread’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:233: error: implicit declaration of function ‘PyErr_Clear’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:237: error: implicit declaration of function ‘PyImport_ReloadModule’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:254: error: implicit declaration of function ‘mod_python_conjure_session’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:258: error: implicit declaration of function ‘mod_python_conjure_event’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:262: error: implicit declaration of function ‘mod_python_conjure_stream’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:269: error: implicit declaration of function ‘Py_BuildValue’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:282: error: implicit declaration of function ‘PyEval_CallObjectWithKeywords’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:282: error: expected expression before ‘)’ token
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:283: error: implicit declaration of function ‘Py_DECREF’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:291: error: implicit declaration of function ‘PyErr_ExceptionMatches’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:291: error: ‘PyExc_SystemExit’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:296: error: implicit declaration of function ‘PyRun_SimpleString’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:297: error: implicit declaration of function ‘PyGC_Collect’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:312: error: implicit declaration of function ‘PyThreadState_Clear’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:313: error: implicit declaration of function ‘PyEval_ReleaseThread’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:314: error: implicit declaration of function ‘PyThreadState_Delete’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c: In function ‘set_max_recursion_depth’:
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:403: error: ‘PyObject’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:403: error: ‘sysModule’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:404: error: ‘setRecursionLimit’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:405: error: ‘recLimit’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:406: error: ‘setrecursion_result’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:406: error: expected expression before ‘)’ token
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c: In function ‘mod_python_load’:
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:532: error: implicit declaration of function ‘Py_IsInitialized’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:535: error: implicit declaration of function ‘Py_Initialize’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:538: error: implicit declaration of function ‘PyEval_InitThreads’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:542: error: ‘mainThreadState’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:542: error: implicit declaration of function ‘PyThreadState_Get’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:549: error: implicit declaration of function ‘PyThreadState_Swap’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:552: error: implicit declaration of function ‘PyEval_ReleaseLock’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c: In function ‘mod_python_shutdown’:
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:575: error: ‘PyInterpreterState’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:575: error: ‘mainInterpreterState’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:576: error: ‘PyThreadState’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:576: error: ‘myThreadState’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:577: error: ISO C90 forbids mixed declarations and code
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:584: error: implicit declaration of function ‘PyEval_AcquireLock’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:592: error: ‘struct switch_py_thread’ has no member named ‘tstate’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:593: error: implicit declaration of function ‘PyThreadState_SetAsyncExc’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:593: error: ‘struct switch_py_thread’ has no member named ‘tstate’
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:593: error: ‘PyExc_SystemExit’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:597: error: ‘mainThreadState’ undeclared (first use in this function)
/usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c:627: error: implicit declaration of function ‘Py_Finalize’
make[5]: *** [mod_python.lo] Error 1
make[4]: *** [all] Error 1
make[3]: *** [mod_python-all] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Now I have gotten this to work with CentOS 6.3 and Python 2.6... but basically it looks like I need to install the developer tools for Python 2.7 (but they don't seem to exist for CentOS 6.3.
I have tried to build Python 2.7 with --enable-shared. I have tried to add -fPIC to the CC= line in the Python makefile. I have also installed setuptools-0.6c11-py2.7.egg, but nothing seems to help. Any ideas?
Also, I think an ISO would be great. Any progress?