module 'lapp-mk4' not found, and I'm not able to install it
GTP95 opened this issue · 5 comments
Greetings,
I'm trying to use this tool to convert a Latex book to an ebook, but when I try to invoke it I get the following error:
$ tex4ebook ~/Download/faif-2.0/faif-2.0.tex
/usr/bin/tex4ebook:6: module 'lapp-mk4' not found:
no field package.preload['lapp-mk4']
[kpse lua searcher] file not found: 'lapp-mk4'
[kpse C searcher] file not found: 'lapp-mk4'
I thought that lapp-mk4
was a Lua module, but luarocks
isn't able to find it:
$ luarocks --local install --check-lua-versions lapp-mk4
lapp-mk4 not found for Lua 5.4.
Checking if available for other Lua versions...
Checking for Lua 5.1...
Checking for Lua 5.2...
Checking for Lua 5.3...
Error: No results matching query were found for Lua 5.4.
lapp-mk4 is not available for any Lua versions.
How can I install this missing dependency?
tex4ebook
uses lot of Lua modules, but they are not installed in directories where stock Lua would find them. It uses the LuaTeX's version of Lua, which uses it's own mechanism for package loading. You can lookup for any file in TeX distribution using the kpsewhich
command:
$ kpsewhich lapp-mk4.lua
/home/michal/texmf/scripts/lua/make4ht/lapp-mk4.lua
The lapp-mk4
is included in make4th.
Both make4ht
and tex4ebook
are included in TeX distributions, so in general, you don't need to install them from sources, you will probably just need to install a right package from your Linux distro. Another possibility is to install full TeX Live.
Thank you for your reply. This looks strange, as I did install TeX using my distro's package manager and indeed it came with text4ebook
preinstalled, but it is complaining about the missing dependency. Furthermore I'm not able to reinstall it:
$ tlmgr --usermode install make4ht tex4ebook
tlmgr: package repository http://mirrors.rit.edu/CTAN/systems/texlive/tlnet (not verified: pubkey missing)
tlmgr: package make4ht is not relocatable, cannot install it in user mode!
tlmgr: package tex4ebook is not relocatable, cannot install it in user mode!
$sudo tlmgr install make4ht tex4ebook
[sudo] password di giacomo:
tlmgr: package repository /usr/share (not verified: unknown)
tlmgr install: package already present: make4ht
tlmgr install: package already present: tex4ebook
The repo isn't configured correctly if I run it as root, but I don't think it matters if it just skips installation because it is already present. Trying to update the installed packages gives
$ sudo tlmgr update --all
tlmgr: package repository /usr/share (not verified: unknown)
tlmgr: backupdir as set in tlpdb
/usr/share/tlpkg/backups
is not a directory.
tlmgr: An error has occurred. See above messages. Exiting.
$ tlmgr --usermode update --all
tlmgr: package repository http://mirrors.rit.edu/CTAN/systems/texlive/tlnet (not verified: pubkey missing)
tlmgr: backupdir as set in tlpdb
/home/giacomo/texmf/tlpkg/backups
is not a directory.
tlmgr: An error has occurred. See above messages. Exiting.
I could try to look up how to force reinstallation of packages or how to fix the repo for the root user, but to make the matter even stranger
$ kpsewhich lapp-mk4.lua
/usr/share/texmf-dist/scripts/make4ht/lapp-mk4.lua
So the dependency seems to be installed, but somehow text4ebook
isn't able to load it.
Maybe there is a clash between TeX Live from your Linux distro and one installed manually? The files installed by tlmgr
are usually placed in the directory for the current TL version, for example:
/usr/local/texlive/2023/texmf-dist/scripts/make4ht/lapp-mk4.lua
The binaries for my TeX Live are placed in
/usr/local/texlive/2023/bin/x86_64-linux
Hi, sorry for taking so long to get back to you. I don't think I have both a manually installed environment and one installed with my package manager, but it is still clearly a local issue, as in the end, I was able to convert the file using a Docker container. If you would like me to perform some more troubleshooting steps I will be happy to, otherwise it is problem solved for me.
OK, I think we can close this now, I am happy that you were able to solve it in the end.