lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Thanks Charles,

I tried installing lunatic-python but it failed. See below the complete error messages-

-------------------------------------------------------------
ravi@ravi-pc:~/Downloads/lunatic-python-1.0$ make
python setup.py build
running build
running build_ext
building 'lua-python' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/pythoninlua.c -o build/temp.linux-x86_64-2.7/src/pythoninlua.o -rdynamic
src/pythoninlua.c: In function ‘py_convert’:
src/pythoninlua.c:74:3: warning: passing argument 3 of ‘PyString_AsStringAndSize’ from incompatible pointer type [enabled by default]
   PyString_AsStringAndSize(o, &s, &len);
   ^
In file included from /usr/include/python2.7/Python.h:94:0,
                 from src/pythoninlua.c:23:
/usr/include/python2.7/stringobject.h:172:17: note: expected ‘Py_ssize_t *’ but argument is of type ‘int *’
 PyAPI_FUNC(int) PyString_AsStringAndSize(
                 ^
src/pythoninlua.c: In function ‘py_object_tostring’:
src/pythoninlua.c:335:4: warning: passing argument 3 of ‘PyString_AsStringAndSize’ from incompatible pointer type [enabled by default]
    PyString_AsStringAndSize(repr, &s, &len);
    ^
In file included from /usr/include/python2.7/Python.h:94:0,
                 from src/pythoninlua.c:23:
/usr/include/python2.7/stringobject.h:172:17: note: expected ‘Py_ssize_t *’ but argument is of type ‘int *’
 PyAPI_FUNC(int) PyString_AsStringAndSize(
                 ^
src/pythoninlua.c: At top level:
src/pythoninlua.c:343:1: error: unknown type name ‘luaL_reg’
 static const luaL_reg py_object_lib[] = {
 ^
src/pythoninlua.c:344:2: warning: braces around scalar initializer [enabled by default]
  {"__call", py_object_call},
  ^
src/pythoninlua.c:344:2: warning: (near initialization for ‘py_object_lib[0]’) [enabled by default]
src/pythoninlua.c:344:2: warning: initialization makes integer from pointer without a cast [enabled by default]
src/pythoninlua.c:344:2: warning: (near initialization for ‘py_object_lib[0]’) [enabled by default]
src/pythoninlua.c:344:2: error: initializer element is not computable at load time
src/pythoninlua.c:344:2: error: (near initialization for ‘py_object_lib[0]’)
src/pythoninlua.c:344:2: warning: excess elements in scalar initializer [enabled by default]
src/pythoninlua.c:344:2: warning: (near initialization for ‘py_object_lib[0]’) [enabled by default]
src/pythoninlua.c:345:2: warning: braces around scalar initializer [enabled by default]
  {"__index", py_object_index},
  ^
src/pythoninlua.c:345:2: warning: (near initialization for ‘py_object_lib[1]’) [enabled by default]
src/pythoninlua.c:345:2: warning: initialization makes integer from pointer without a cast [enabled by default]
src/pythoninlua.c:345:2: warning: (near initialization for ‘py_object_lib[1]’) [enabled by default]
src/pythoninlua.c:345:2: error: initializer element is not computable at load time
src/pythoninlua.c:345:2: error: (near initialization for ‘py_object_lib[1]’)
src/pythoninlua.c:345:2: warning: excess elements in scalar initializer [enabled by default]
src/pythoninlua.c:345:2: warning: (near initialization for ‘py_object_lib[1]’) [enabled by default]
src/pythoninlua.c:346:2: warning: braces around scalar initializer [enabled by default]
  {"__newindex", py_object_newindex},
  ^
src/pythoninlua.c:346:2: warning: (near initialization for ‘py_object_lib[2]’) [enabled by default]
src/pythoninlua.c:346:2: warning: initialization makes integer from pointer without a cast [enabled by default]
src/pythoninlua.c:346:2: warning: (near initialization for ‘py_object_lib[2]’) [enabled by default]
src/pythoninlua.c:346:2: error: initializer element is not computable at load time
src/pythoninlua.c:346:2: error: (near initialization for ‘py_object_lib[2]’)
src/pythoninlua.c:346:2: warning: excess elements in scalar initializer [enabled by default]
src/pythoninlua.c:346:2: warning: (near initialization for ‘py_object_lib[2]’) [enabled by default]
src/pythoninlua.c:347:2: warning: braces around scalar initializer [enabled by default]
  {"__gc", py_object_gc},
  ^
src/pythoninlua.c:347:2: warning: (near initialization for ‘py_object_lib[3]’) [enabled by default]
src/pythoninlua.c:347:2: warning: initialization makes integer from pointer without a cast [enabled by default]
src/pythoninlua.c:347:2: warning: (near initialization for ‘py_object_lib[3]’) [enabled by default]
src/pythoninlua.c:347:2: error: initializer element is not computable at load time
src/pythoninlua.c:347:2: error: (near initialization for ‘py_object_lib[3]’)
src/pythoninlua.c:347:2: warning: excess elements in scalar initializer [enabled by default]
src/pythoninlua.c:347:2: warning: (near initialization for ‘py_object_lib[3]’) [enabled by default]
src/pythoninlua.c:348:2: warning: braces around scalar initializer [enabled by default]
  {"__tostring", py_object_tostring},
  ^
src/pythoninlua.c:348:2: warning: (near initialization for ‘py_object_lib[4]’) [enabled by default]
src/pythoninlua.c:348:2: warning: initialization makes integer from pointer without a cast [enabled by default]
src/pythoninlua.c:348:2: warning: (near initialization for ‘py_object_lib[4]’) [enabled by default]
src/pythoninlua.c:348:2: error: initializer element is not computable at load time
src/pythoninlua.c:348:2: error: (near initialization for ‘py_object_lib[4]’)
src/pythoninlua.c:348:2: warning: excess elements in scalar initializer [enabled by default]
src/pythoninlua.c:348:2: warning: (near initialization for ‘py_object_lib[4]’) [enabled by default]
src/pythoninlua.c:349:2: warning: braces around scalar initializer [enabled by default]
  {NULL, NULL}
  ^
src/pythoninlua.c:349:2: warning: (near initialization for ‘py_object_lib[5]’) [enabled by default]
src/pythoninlua.c:349:2: warning: initialization makes integer from pointer without a cast [enabled by default]
src/pythoninlua.c:349:2: warning: (near initialization for ‘py_object_lib[5]’) [enabled by default]
src/pythoninlua.c:349:2: warning: excess elements in scalar initializer [enabled by default]
src/pythoninlua.c:349:2: warning: (near initialization for ‘py_object_lib[5]’) [enabled by default]
src/pythoninlua.c:545:1: error: unknown type name ‘luaL_reg’
 static const luaL_reg py_lib[] = {
 ^
src/pythoninlua.c:546:2: warning: braces around scalar initializer [enabled by default]
  {"execute", py_execute},
  ^
src/pythoninlua.c:546:2: warning: (near initialization for ‘py_lib[0]’) [enabled by default]
src/pythoninlua.c:546:2: warning: initialization makes integer from pointer without a cast [enabled by default]
src/pythoninlua.c:546:2: warning: (near initialization for ‘py_lib[0]’) [enabled by default]
src/pythoninlua.c:546:2: error: initializer element is not computable at load time
src/pythoninlua.c:546:2: error: (near initialization for ‘py_lib[0]’)
src/pythoninlua.c:546:2: warning: excess elements in scalar initializer [enabled by default]
src/pythoninlua.c:546:2: warning: (near initialization for ‘py_lib[0]’) [enabled by default]
src/pythoninlua.c:547:2: warning: braces around scalar initializer [enabled by default]
  {"eval", py_eval},
  ^
src/pythoninlua.c:547:2: warning: (near initialization for ‘py_lib[1]’) [enabled by default]
src/pythoninlua.c:547:2: warning: initialization makes integer from pointer without a cast [enabled by default]
src/pythoninlua.c:547:2: warning: (near initialization for ‘py_lib[1]’) [enabled by default]
src/pythoninlua.c:547:2: error: initializer element is not computable at load time
src/pythoninlua.c:547:2: error: (near initialization for ‘py_lib[1]’)
src/pythoninlua.c:547:2: warning: excess elements in scalar initializer [enabled by default]
src/pythoninlua.c:547:2: warning: (near initialization for ‘py_lib[1]’) [enabled by default]
src/pythoninlua.c:548:2: warning: braces around scalar initializer [enabled by default]
  {"asindx", py_asindx},
  ^
src/pythoninlua.c:548:2: warning: (near initialization for ‘py_lib[2]’) [enabled by default]
src/pythoninlua.c:548:2: warning: initialization makes integer from pointer without a cast [enabled by default]
src/pythoninlua.c:548:2: warning: (near initialization for ‘py_lib[2]’) [enabled by default]
src/pythoninlua.c:548:2: error: initializer element is not computable at load time
src/pythoninlua.c:548:2: error: (near initialization for ‘py_lib[2]’)
src/pythoninlua.c:548:2: warning: excess elements in scalar initializer [enabled by default]
src/pythoninlua.c:548:2: warning: (near initialization for ‘py_lib[2]’) [enabled by default]
src/pythoninlua.c:549:2: warning: braces around scalar initializer [enabled by default]
  {"asattr", py_asattr},
  ^
src/pythoninlua.c:549:2: warning: (near initialization for ‘py_lib[3]’) [enabled by default]
src/pythoninlua.c:549:2: warning: initialization makes integer from pointer without a cast [enabled by default]
src/pythoninlua.c:549:2: warning: (near initialization for ‘py_lib[3]’) [enabled by default]
src/pythoninlua.c:549:2: error: initializer element is not computable at load time
src/pythoninlua.c:549:2: error: (near initialization for ‘py_lib[3]’)
src/pythoninlua.c:549:2: warning: excess elements in scalar initializer [enabled by default]
src/pythoninlua.c:549:2: warning: (near initialization for ‘py_lib[3]’) [enabled by default]
src/pythoninlua.c:550:2: warning: braces around scalar initializer [enabled by default]
  {"asfunc", py_asfunc},
  ^
src/pythoninlua.c:550:2: warning: (near initialization for ‘py_lib[4]’) [enabled by default]
src/pythoninlua.c:550:2: warning: initialization makes integer from pointer without a cast [enabled by default]
src/pythoninlua.c:550:2: warning: (near initialization for ‘py_lib[4]’) [enabled by default]
src/pythoninlua.c:550:2: error: initializer element is not computable at load time
src/pythoninlua.c:550:2: error: (near initialization for ‘py_lib[4]’)
src/pythoninlua.c:550:2: warning: excess elements in scalar initializer [enabled by default]
src/pythoninlua.c:550:2: warning: (near initialization for ‘py_lib[4]’) [enabled by default]
src/pythoninlua.c:551:2: warning: braces around scalar initializer [enabled by default]
  {"locals", py_locals},
  ^
src/pythoninlua.c:551:2: warning: (near initialization for ‘py_lib[5]’) [enabled by default]
src/pythoninlua.c:551:2: warning: initialization makes integer from pointer without a cast [enabled by default]
src/pythoninlua.c:551:2: warning: (near initialization for ‘py_lib[5]’) [enabled by default]
src/pythoninlua.c:551:2: error: initializer element is not computable at load time
src/pythoninlua.c:551:2: error: (near initialization for ‘py_lib[5]’)
src/pythoninlua.c:551:2: warning: excess elements in scalar initializer [enabled by default]
src/pythoninlua.c:551:2: warning: (near initialization for ‘py_lib[5]’) [enabled by default]
src/pythoninlua.c:552:2: warning: braces around scalar initializer [enabled by default]
  {"globals", py_globals},
  ^
src/pythoninlua.c:552:2: warning: (near initialization for ‘py_lib[6]’) [enabled by default]
src/pythoninlua.c:552:2: warning: initialization makes integer from pointer without a cast [enabled by default]
src/pythoninlua.c:552:2: warning: (near initialization for ‘py_lib[6]’) [enabled by default]
src/pythoninlua.c:552:2: error: initializer element is not computable at load time
src/pythoninlua.c:552:2: error: (near initialization for ‘py_lib[6]’)
src/pythoninlua.c:552:2: warning: excess elements in scalar initializer [enabled by default]
src/pythoninlua.c:552:2: warning: (near initialization for ‘py_lib[6]’) [enabled by default]
src/pythoninlua.c:553:2: warning: braces around scalar initializer [enabled by default]
  {"builtins", py_builtins},
  ^
src/pythoninlua.c:553:2: warning: (near initialization for ‘py_lib[7]’) [enabled by default]
src/pythoninlua.c:553:2: warning: initialization makes integer from pointer without a cast [enabled by default]
src/pythoninlua.c:553:2: warning: (near initialization for ‘py_lib[7]’) [enabled by default]
src/pythoninlua.c:553:2: error: initializer element is not computable at load time
src/pythoninlua.c:553:2: error: (near initialization for ‘py_lib[7]’)
src/pythoninlua.c:553:2: warning: excess elements in scalar initializer [enabled by default]
src/pythoninlua.c:553:2: warning: (near initialization for ‘py_lib[7]’) [enabled by default]
src/pythoninlua.c:554:2: warning: braces around scalar initializer [enabled by default]
  {"import", py_import},
  ^
src/pythoninlua.c:554:2: warning: (near initialization for ‘py_lib[8]’) [enabled by default]
src/pythoninlua.c:554:2: warning: initialization makes integer from pointer without a cast [enabled by default]
src/pythoninlua.c:554:2: warning: (near initialization for ‘py_lib[8]’) [enabled by default]
src/pythoninlua.c:554:2: error: initializer element is not computable at load time
src/pythoninlua.c:554:2: error: (near initialization for ‘py_lib[8]’)
src/pythoninlua.c:554:2: warning: excess elements in scalar initializer [enabled by default]
src/pythoninlua.c:554:2: warning: (near initialization for ‘py_lib[8]’) [enabled by default]
src/pythoninlua.c:555:2: warning: braces around scalar initializer [enabled by default]
  {NULL, NULL}
  ^
src/pythoninlua.c:555:2: warning: (near initialization for ‘py_lib[9]’) [enabled by default]
src/pythoninlua.c:555:2: warning: initialization makes integer from pointer without a cast [enabled by default]
src/pythoninlua.c:555:2: warning: (near initialization for ‘py_lib[9]’) [enabled by default]
src/pythoninlua.c:555:2: warning: excess elements in scalar initializer [enabled by default]
src/pythoninlua.c:555:2: warning: (near initialization for ‘py_lib[9]’) [enabled by default]
src/pythoninlua.c: In function ‘luaopen_python’:
src/pythoninlua.c:563:2: warning: implicit declaration of function ‘luaL_openlib’ [-Wimplicit-function-declaration]
  luaL_openlib(L, "python", py_lib, 0);
  ^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
make: *** [all] Error 1
ravi@ravi-pc:~/Downloads/lunatic-python-1.0$
-------------------------------------------------------------

OS and Lua details are following-
-------------------------------------------------------------
ravi@ravi-pc:~/Downloads/lunatic-python-1.0$ lua -v
Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio
ravi@ravi-pc:~/Downloads/lunatic-python-1.0$ uname -a
Linux ravi-pc 4.4.0-45-generic #66~14.04.1-Ubuntu SMP Wed Oct 19 15:05:38 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
ravi@ravi-pc:~/Downloads/lunatic-python-1.0$ python 
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
-------------------------------------------------------------

Apologies for the long email but I can't send email without error log.

-
Thanks
Ravi



On Monday, 7 November 2016 12:00 PM, Charles Heywood <vandor2012@gmail.com> wrote:


"better"

On Sun, Nov 6, 2016 at 2:01 PM Michal Kottman <michal.kottman@gmail.com> wrote:
On 6 November 2016 at 17:11, Marc Balmer <marc@msys.ch> wrote:
short: 
You can't call python module from lua. 
This can not be true.  Python has a C API and so does Lua.  It must be possible to call Python from Lua somehow.
It's even better: using https://labix.org/lunatic-python - which is a two-way bridge between Lua and Python - you can call Python functions from Lua and the other way round. You should be able to simply call python.import(module_name) from Lua and use the module directly.
--