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

Install Pandoc inside Azure Function for Pypandoc #207

Closed
arpalani opened this issue Jan 30, 2021 · 2 comments
Closed

Install Pandoc inside Azure Function for Pypandoc #207

arpalani opened this issue Jan 30, 2021 · 2 comments

Comments

@arpalani
Copy link

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:

  1. Use pandoc_download

    from pypandoc.pandoc_download import download_pandoc
  2. Use wdc. This does not fix the problem.

  3. 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?

@JessicaTegner
Copy link
Owner

JessicaTegner commented Jun 30, 2021

Hi there

If you know the installation path of pandoc, you can hard code it in with the following

os.environ.setdefault('PYPANDOC_PANDOC', "C:/full/path/to/pandoc/folder/")

@JessicaTegner
Copy link
Owner

Hi. Since I haven't heard anything, I'll mark this issue as closed.
If you still need help, or have found a bug, feel free to reopen or make a new issue :)

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