TexMaths extension doesn't work, everything is in the correct location

I have Ubuntu 16.04.7 LTS. I am using the current LibreOffice Macro MathTex in Impress and have checked the Latex configurations numerous times but I cannot find a solution to the error “An error has occurred. Please check your Latex configurations.”
Everything is in the correct location and I am using TexMaths-0.48.2

Does anybody know how to fix this?