I am using the package pypandoc for converting DOC/DOCX files into HTML. This has a prerequisite of Pandoc being already installed. When both packages are installed using the requirements.txt
file, it works locally. When I deploy it as an Azure Function, however, it always gives a "module not found" error. (pypandoc cannot find pandoc in the same path because it gets installed elsewhere.)
This seems like a known issue. Pandoc does not get installed in the same path as Pyandoc and there are multiple solutions suggested. But they only locally.
Options tried:
Use pandoc_download
from pypandoc.pandoc_download import download_pandoc
Use wdc. This does not fix the problem.
Use wheel files that include Pandoc.
Right now I am using mammoth for conversion which is slightly lower in accuracy, but gets deployed on Az. How can I get Pypandoc working as an Azure Function? How can I install Pandoc in a place where Pypandoc can find it? Or, how can I tell Pypandoc where to find Pandoc?