I have a problem to get a lua script (using luasql installed via luarocks) working within lualatex. The lua script basically retrieves data from a mysql database. But within lualatex, the necessary require("luasql.mysql") statement is not working (module 'luasql.mysql' not found). I also tried \usepackage{luapackageloader}, but the require statement is still not working.
I discovered that within a lua shell the commands print(package.cpath) and print(package.path) show the actual correct directories, but outputs generated by \directlua{tex.print(package.cpath)} and \directlua{tex.print(package.path)} within lualatex showing non-existent directories (mainly differing in the version numbers of lua 5.3 vs. 5.4).
Is there any way to update the package path within lualatex? I tried to regenerate all format files without success.
Any help would be appreciated.
BTW: I am using TeX Live 2022 installed on Arch Linux via pacman...
--shell-escape– David Carlisle Jan 31 '23 at 11:03texmf.cnf– David Carlisle Jan 31 '23 at 11:05lualatexnow finds theluasql.mysqlmodule after appropriately adjustingCLUAINPUTSintexmf.cnfbut fails to interpret the module due toundefined symbol: lua_newuserdatauv. This might be a version conflict resulting from different lua versions as stated by Marcel, althoughluasqlshould work with lua version >5.1. – fermikante Jan 31 '23 at 15:19