Trouble installing FreePyBX with CentOS 6.3 and Python 2.7.3

53 views
Skip to first unread message

wboy1

unread,
Oct 6, 2012, 10:52:46 PM10/6/12
to Free...@googlegroups.com
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

Basically I get an error from freeswitch while trying to build mod_python

<<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
<<QUOTED TEXT ENDS HERE>>

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?

Max Kovalenko

unread,
Jan 15, 2013, 7:22:45 AM1/15/13
to Free...@googlegroups.com
I also met with an issue while do make of Freeswitch with recommended Python2.7 under CentOS 6.3:

making all mod_python
Compiling freeswitch_python.cpp...
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from /usr/include/python2.7/Python.h:8,
                 from freeswitch_python.h:5,
                 from freeswitch_python.cpp:3:
/usr/include/python2.7/pyconfig.h:1161:1: warning: "_POSIX_C_SOURCE" redefined
In file included from /usr/include/stdlib.h:25,
                 from /usr/src/freeswitch/src/include/switch.h:76,
                 from freeswitch_python.cpp:2:
/usr/include/features.h:162:1: warning: this is the location of the previous definition
In file included from /usr/include/python2.7/Python.h:8,
                 from freeswitch_python.h:5,
                 from freeswitch_python.cpp:3:
/usr/include/python2.7/pyconfig.h:1183:1: warning: "_XOPEN_SOURCE" redefined
In file included from /usr/include/stdlib.h:25,
                 from /usr/src/freeswitch/src/include/switch.h:76,
                 from freeswitch_python.cpp:2:
/usr/include/features.h:164:1: warning: this is the location of the previous definition
freeswitch_python.cpp: In member function ‘virtual switch_status_t PYTHON::Session::run_dtmf_callback(void*, switch_input_type_t)’:
freeswitch_python.cpp:287: warning: deprecated conversion from string constant to ‘char*’
freeswitch_python.cpp:302: warning: deprecated conversion from string constant to ‘char*’
freeswitch_python.cpp:304: warning: deprecated conversion from string constant to ‘char*’
Compiling mod_python_wrap.cpp...
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
mod_python_wrap.cpp: In function ‘PyObject* _wrap_new_Stream(PyObject*, PyObject*)’:
mod_python_wrap.cpp:4191: warning: ‘argv[0]’ may be used uninitialized in this function
Compiling /usr/src/freeswitch/src/mod/languages/mod_python/mod_python.c...
quiet_libtool: compile:  gcc -I/usr/include/python2.7 -I/usr/include/python2.7 -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -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 -I/usr/src/freeswitch/libs/stfu -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
quiet_libtool: compile:  gcc -I/usr/include/python2.7 -I/usr/include/python2.7 -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -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 -I/usr/src/freeswitch/libs/stfu -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 -o mod_python.o >/dev/null 2>&1
Creating mod_python.la...
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../libpython2.7.a(abstract.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
cat: .libs/mod_python.log: No such file or directory
make[5]: *** [mod_python.la] 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


To wboy1 : did you obtained full functionality described on PyPBX site with Python 2.6? Perhaps I'll do the same - to construct everything on python 2.6
Reply all
Reply to author
Forward
0 new messages