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

lupa._lupa.LuaError: [string "<python>"]:1: attempt to call a nil value (field 'pow') #214

Open
ldc0111 opened this issue May 11, 2022 · 4 comments

Comments

@ldc0111
Copy link

ldc0111 commented May 11, 2022

    lua = lupa.LuaRuntime()
    lua_func = lua.eval("function (round) local min = 3     local max = 15     if round >= 3 then         min = math.pow(2,3)        max = 20     end     return min,max  end")
    print(lua_func(3))
@Le0Developer
Copy link
Contributor

Can't reproduce with Lua 5.4. What's your lua version? (lua.lua_implementation)

>>> lua_func = lua.eval("function (round) local min = 3     local max = 15     if round >= 3 then         min = math.pow(2,3)        max = 20     end     return min,max  end")
>>> lua_func(3)
(8.0, 20)
>>> lua.lua_implementation
'Lua 5.4'

@ldc0111
Copy link
Author

ldc0111 commented Jun 15, 2022

lua version is 5.4
OS is Windows
python version is 3.7

@Le0Developer
Copy link
Contributor

Can't reproduce

>>> import lupa
>>> lua = lupa.LuaRuntime()
>>> lua_func = lua.eval("function (round) local min = 3     local max = 15     if round >= 3 then         min = math.pow(2,3)        max = 20     end     return min,max  end")
>>> print(lua_func(3))
(8, 20)
>>> lua.lua_implementation
'Lua 5.4'
>>> import sys
>>> sys.version_info
sys.version_info(major=3, minor=7, micro=9, releaselevel='final', serial=0)

@ldc0111
Copy link
Author

ldc0111 commented Jun 22, 2022

Thank you. I'll try again

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

2 participants