Fix “nbconvert failed: xelatex not found on PATH” (Jupyter PDF Error)
Why Jupyter shows “nbconvert failed: xelatex not found on PATH” or “Pandoc wasn't found” when exporting to PDF, and how to fix it on Windows, Mac and Linux.
Quick answer: The error means Jupyter’s PDF export needs a LaTeX program called xelatex that isn’t installed. Fix it by installing a TeX distribution (MiKTeX on Windows, MacTeX on Mac, texlive-xetex on Linux) plus pandoc and restarting Jupyter, or avoid LaTeX entirely by using WebPDF or a browser-based converter.
Why the error happens
jupyter nbconvert --to pdf (and “Download as PDF via LaTeX”) first turns the notebook into a LaTeX document, then runs xelatex to make the PDF. If no TeX distribution is installed, or it isn’t on your PATH, you see:
nbconvert failed: xelatex not found on PATH, if you have not installed xelatex you may need to do so.
A similar message, “Pandoc wasn’t found”, means pandoc is missing; it is also required.
Fix on Windows
- Install MiKTeX from miktex.org and allow it to install missing packages automatically.
- Install pandoc from pandoc.org.
- Close and reopen your terminal and Jupyter so the new PATH is picked up.
Fix on macOS
Install MacTeX (or the smaller BasicTeX) and pandoc, for example with Homebrew:
brew install --cask mactex-no-gui
brew install pandoc
Fix on Ubuntu / Debian Linux
sudo apt-get install texlive-xetex texlive-fonts-recommended texlive-plain-generic pandoc
Avoid LaTeX completely
- WebPDF:
pip install "nbconvert[webpdf]", thenjupyter nbconvert --to webpdf --allow-chromium-download notebook.ipynb. - Browser converter: open the notebook in ipynbtopdfscanner. No LaTeX, pandoc or Python is needed, and it works on phones too.
Skip the setup: convert your notebook to PDF in your browser, free and private.
Open the converterFrequently asked questions
I installed MiKTeX but still get the error. What now?
Restart your computer or at least every terminal and Jupyter window, so the updated PATH is used. Then run xelatex --version in a terminal to confirm it is found.
Is LaTeX needed to make a PDF from a notebook?
Only for nbconvert’s classic PDF exporter. WebPDF and browser-based converters don’t need LaTeX.