error installing python version

Issue #3 resolved
Former user created an issue

Python compilation and installation failed.

./configure --enable-openmp and make install went ok. The lib.a was built in some local/usr folder.

Then "./configure --prefix=/disk/usr --enable-python". The output added this:

{{{ checking for python with numpy package... python python include path = /usr/include/python2.6 numpy include path = /usr/lib/python2.6/dist-packages/numpy/core/include verbose level = 1 }}}

Then i called "make PREFIX=/olddisk/usr install". Output (part of it!) error log:

{{{ #!log

python setup.py build running build running build_py running build_ext building '_shtns' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/python2.6/dist-packages/numpy/core/include -I/usr/include/python2.6 -c shtns_numpy_wrap.c -o build/temp.linux-x86_64-2.6/shtns_numpy_wrap.o -fopenmp shtns_numpy_wrap.c:125:20: error: Python.h: No such file or directory shtns_numpy_wrap.c:764: error: expected ‘)’ before ‘’ token shtns_numpy_wrap.c:788: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token ... /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:1084: error: expected specifier-qualifier-list before ‘npy_intp’ In file included from /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:1099, from /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/arrayobject.h:14, from shtns_numpy_wrap.c:2971: /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/multiarray_api.h: In function ‘_import_array’: /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:971: error: ‘PyObject’ undeclared (first use in this function) /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:971: error: ‘numpy’ undeclared (first use in this function) /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:971: warning: implicit declaration of function ‘PyImport_ImportModule’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:972: error: ‘c_api’ undeclared (first use in this function) /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:974: warning: implicit declaration of function ‘PyObject_GetAttrString’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:976: warning: implicit declaration of function ‘PyCObject_Check’ /usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:984: error: ‘PyExc_RuntimeError’ undeclared (first use in this function) shtns_numpy_wrap.c: At top level: shtns_numpy_wrap.c:3415: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute’ before ‘’ token shtns_numpy_wrap.c:3437: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token shtns_numpy_wrap.c:3459: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token shtns_numpy_wrap.c:3481: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token shtns_numpy_wrap.c:3503: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token shtns_numpy_wrap.c:3525: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token shtns_numpy_wrap.c:3547: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token shtns_numpy_wrap.c:4715: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘SwigMethods’ shtns_numpy_wrap.c:5053: error: expected specifier-qualifier-list before ‘PyObject’ shtns_numpy_wrap.c:5059: error: expected specifier-qualifier-list before ‘PyObject_HEAD’ shtns_numpy_wrap.c:5063: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token shtns_numpy_wrap.c:5072: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token shtns_numpy_wrap.c:5111: error: expected declaration specifiers or ‘...’ before ‘FILE’ shtns_numpy_wrap.c: In function ‘swig_varlink_print’: shtns_numpy_wrap.c:5113: error: ‘PyObject’ undeclared (first use in this function) shtns_numpy_wrap.c:5113: error: ‘str’ undeclared (first use in this function) shtns_numpy_wrap.c:5113: warning: implicit declaration of function ‘swig_varlink_str’ shtns_numpy_wrap.c:5114: warning: implicit declaration of function ‘fprintf’ shtns_numpy_wrap.c:5114: warning: incompatible implicit declaration of built-in function ‘fprintf’ shtns_numpy_wrap.c:5114: error: ‘fp’ undeclared (first use in this function) shtns_numpy_wrap.c: In function ‘swig_varlink_dealloc’: shtns_numpy_wrap.c:5123: error: ‘swig_varlinkobject’ has no member named ‘vars’ shtns_numpy_wrap.c:5125: error: ‘swig_globalvar’ has no member named ‘next’ shtns_numpy_wrap.c: At top level: shtns_numpy_wrap.c:5132: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token shtns_numpy_wrap.c:5150: error: expected declaration specifiers or ‘...’ before ‘PyObject’ shtns_numpy_wrap.c: In function ‘swig_varlink_setattr’: shtns_numpy_wrap.c:5152: error: ‘swig_varlinkobject’ has no member named ‘vars’ shtns_numpy_wrap.c:5155: error: ‘swig_globalvar’ has no member named ‘set_attr’ shtns_numpy_wrap.c:5155: error: ‘p’ undeclared (first use in this function) shtns_numpy_wrap.c:5158: error: ‘swig_globalvar’ has no member named ‘next’ shtns_numpy_wrap.c:5161: error: ‘PyExc_NameError’ undeclared (first use in this function) shtns_numpy_wrap.c: At top level: shtns_numpy_wrap.c:5166: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token shtns_numpy_wrap.c:5230: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token shtns_numpy_wrap.c:5240: error: expected ‘)’ before ‘’ token shtns_numpy_wrap.c:5256: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token shtns_numpy_wrap.c:5269: error: expected ‘)’ before ‘’ token shtns_numpy_wrap.c:5296: error: expected ‘)’ before ‘’ token shtns_numpy_wrap.c: In function ‘init_shtns’: shtns_numpy_wrap.c:5356: error: ‘PyObject’ undeclared (first use in this function) shtns_numpy_wrap.c:5356: error: ‘m’ undeclared (first use in this function) shtns_numpy_wrap.c:5356: error: ‘d’ undeclared (first use in this function) shtns_numpy_wrap.c:5356: warning: left-hand operand of comma expression has no effect shtns_numpy_wrap.c:5356: error: ‘md’ undeclared (first use in this function) shtns_numpy_wrap.c:5356: warning: left-hand operand of comma expression has no effect shtns_numpy_wrap.c:5424: warning: implicit declaration of function ‘SWIG_Python_FixMethods’ shtns_numpy_wrap.c:5424: error: ‘SwigMethods’ undeclared (first use in this function) shtns_numpy_wrap.c:5431: warning: implicit declaration of function ‘PyModule_GetDict’ shtns_numpy_wrap.c:5471: warning: implicit declaration of function ‘SWIG_Python_InstallConstants’ shtns_numpy_wrap.c:5473: warning: implicit declaration of function ‘SWIG_Python_SetConstant’ shtns_numpy_wrap.c:5473: warning: implicit declaration of function ‘SWIG_From_int’ error: command 'gcc' failed with exit status 1 make: *** [_shtns.so] Error 1 }}}

Let me know if you need more info about my configuration. E.

Comments (4)

  1. Nathanaël Schaeffer repo owner

    (Reply via nath...@gmail.com):

    Ok, the first error is that Python.h is missing. What does the command "locate Python.h" tells you ?

    Why do you use prefix for a python install, you do not want the package to be installed in the default python path ?

    On Fri, Jun 29, 2012 at 11:16 AM, emmanuel joliet < issues-reply@bitbucket.org> wrote:

  2. Nathanaël Schaeffer repo owner

    You must probably install a python-devel or python-dev package before you can compile python extensions on your system.

  3. Log in to comment