'Jupyter Notebook Download As LaTeX or PDF fails, but works from command line using nbconvert

Related to this question IPython/Jupyter Problems saving notebook as PDF

On macOS,

jupyter nbconvert example.ipynb --to latex

works just fine. pandoc is on my path at /usr/local/bin/pandoc.

However, within the running notebook, "File: Download as: Latex" results in an error.

500 : Internal Server Error
The error was:
nbconvert failed: Pandoc wasn't found.
Please check that pandoc is installed:
http://pandoc.org/installing.html

Is there a path variable I should be setting somewhere?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source