Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during installation #67

Open
AlbusDum opened this issue Oct 6, 2018 · 4 comments
Open

Error during installation #67

AlbusDum opened this issue Oct 6, 2018 · 4 comments

Comments

@AlbusDum
Copy link

AlbusDum commented Oct 6, 2018

I try to install lunatic python on Windows Server 2016
Already installed:
Lua 5.1.5
Python 3.7
Here is a problem:

C:\Users\Administrator>pip install lunatic-python-universal
Collecting lunatic-python-universal
Using cached https://files.pythonhosted.org/packages/53/47/c764e4a45329ab9e2a83b43a18ce1150a6b5436583ca973e1afba82015c3/lunatic-python-universal-2.1.1.tar.gz
Complete output from command python setup.py egg_info:
pkg-config failed for python (tried python-3.7 and python3.7); most recent output was:
'pkg-config' is not recognized as an internal or external command,
operable program or batch file.

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in C:\Users\ADMINI~1\AppData\Local\Temp\2\pip-install-b7hqeh4i\lunatic-python-universal\

I attach screenshot with error
e3e109e469

Thank you for help.

@penatem1
Copy link

I as well fall into this error.

Also tried building via download & extract and then:
python setup.py build

Hacking together the setup script to ignore the pkg-config stuff you can use this to define the lua pkg-config variable and continue setup:

lua_pkg_config = dict([('libraries', ['lua5.1', 'python36']), ('extra_compile_args', ['']), ('include_dirs', ['C:/Program Files (x86)/Lua/5.1/include', 'C:/Users/mpenate0/AppData/Local/Programs\Python\Python36\include'])])

But it still won't find the lua library file during linking, and if you put the file where it can find it, it still resolved to LINK 2011 error I believe where all the lua functions remain unresolved.

@AlexProfi
Copy link

I get this error with luajit

python setup.py build
running build
running build_ext
building 'lua-python' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-3hk45v/python2.7-2.7.15~rc1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/x86_64-linux-gnu/python2.7 -I/usr/include/python2.7 -I/usr/local/include/luajit-2.1 -I/usr/include/python2.7 -c src/pythoninlua.c -o build/temp.linux-x86_64-2.7/src/pythoninlua.o -I/usr/local/include/luajit-2.1
In file included from src/pythoninlua.c:35:0:
src/luainpython.h:29:0: warning: "luaL_newlib" redefined
  #define luaL_newlib(L, l) (lua_newtable(L), luaL_register(L, NULL, (l)))

In file included from src/pythoninlua.c:32:0:
/usr/local/include/luajit-2.1/lauxlib.h:125:0: note: this is the location of the previous definition
#define luaL_newlib(L, l) (luaL_newlibtable(L, l), luaL_setfuncs(L, l, 0))

x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-3hk45v/python2.7-2.7.15~rc1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/x86_64-linux-gnu/python2.7 -I/usr/include/python2.7 -I/usr/local/include/luajit-2.1 -I/usr/include/python2.7 -c src/luainpython.c -o build/temp.linux-x86_64-2.7/src/luainpython.o -I/usr/local/include/luajit-2.1
In file included from src/luainpython.c:34:0:
src/luainpython.h:29:0: warning: "luaL_newlib" redefined
  #define luaL_newlib(L, l) (lua_newtable(L), luaL_register(L, NULL, (l)))

In file included from src/luainpython.c:30:0:
/usr/local/include/luajit-2.1/lauxlib.h:125:0: note: this is the location of the previous definition
#define luaL_newlib(L, l) (luaL_newlibtable(L, l), luaL_setfuncs(L, l, 0))

In file included from src/luainpython.c:28:0:
/usr/local/include/luajit-2.1/lua.h:43:17: error: expected identifier before numeric constant
#define LUA_OK  0
                ^
src/luainpython.c:307:3: note: in expansion of macro ‘LUA_OK’
  LUA_OK, LUA_OPEQ, LUA_OPLT, LUA_OPLE,
  ^~~~~~
src/luainpython.c: In function ‘lua_compare’:
src/luainpython.c:313:10: error: ‘LUA_OPEQ’ undeclared (first use in this function); did you mean ‘LUA_API’?
    case LUA_OPEQ:
         ^~~~~~~~
         LUA_API
src/luainpython.c:313:10: note: each undeclared identifier is reported only once for each function it appears in
src/luainpython.c:315:10: error: ‘LUA_OPLT’ undeclared (first use in this function); did you mean ‘LUA_OPEQ’?
    case LUA_OPLT:
         ^~~~~~~~
         LUA_OPEQ
src/luainpython.c:317:10: error: ‘LUA_OPLE’ undeclared (first use in this function); did you mean ‘LUA_OPLT’?
    case LUA_OPLE:
         ^~~~~~~~
         LUA_OPLT
src/luainpython.c: In function ‘LuaObject_pcmp’:
src/luainpython.c:329:49: error: ‘LUA_OPEQ’ undeclared (first use in this function); did you mean ‘LUA_API’?
      lua_pushboolean(L, lua_compare(L, -2, -1, LUA_OPEQ));
                                                ^~~~~~~~
                                                LUA_API
src/luainpython.c:337:49: error: ‘LUA_OPLT’ undeclared (first use in this function); did you mean ‘LUA_OPEQ’?
      lua_pushboolean(L, lua_compare(L, -2, -1, LUA_OPLT));
                                                ^~~~~~~~
                                                LUA_OPEQ
src/luainpython.c:342:49: error: ‘LUA_OPLE’ undeclared (first use in this function); did you mean ‘LUA_OPLT’?
      lua_pushboolean(L, lua_compare(L, -2, -1, LUA_OPLE));
                                                ^~~~~~~~
                                                LUA_OPLT
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

In config I use
lua_pkgconfig = pkgconfig('luajit', 'python-' + PYTHONVERSION)
lua_pkgconfig['extra_compile_args'] = ['-I/usr/local/include/luajit-2.1']

How to fix it?

@tangynacho
Copy link

Any resolution for this? Getting the same issue

@aungkhant0911
Copy link

aungkhant0911 commented Oct 6, 2023

same problem on windows

`  from distutils.sysconfig import get_python_lib, get_python_version
pkg-config failed for lua5.1, python-3.10; most recent output was:
Package lua5.1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `lua5.1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'lua5.1' found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants