Jupyter Notebook导出PDF时报错“nbconvert failed: xelatex not found on PATH……”的解决办法

对于没有经过特别配置的Jupyter Notebook,我们在导出文件为PDF时经常会出现以下报错:

nbconvert failed: xelatex not found on PATH, if you have not installed
xelatex you may need to do so. Find further instructions at
https://nbconvert.readthedocs.io/en/latest/install.html#installing-tex.

报错原因:没有安装xelatex

(注意:有些情况下,除过要安装”xelatex”外,还需要安装“pandoc”, 不过Anaconda2-5.0.1以上版本已经默认安装了pandoc,这时就只需要安装”xelatex”)

解决办法:

第一步: 下载并安装“Miktex”软件

下载地址:https://miktex.org/download
《Jupyter Notebook导出PDF时报错“nbconvert failed: xelatex not found on PATH……”的解决办法》

第二步:把上一步安装的Miktex的安装路径添加到环境变量中

Miktex的安装路径: C:\Program Files\MiKTeX\miktex\bin\x64
《Jupyter Notebook导出PDF时报错“nbconvert failed: xelatex not found on PATH……”的解决办法》

第三步:重启Jupyter Notebook, 打开任意一个“ipynb”文件,点击“Download as” – “PDF via LaTeX(.pdf) ”

《Jupyter Notebook导出PDF时报错“nbconvert failed: xelatex not found on PATH……”的解决办法》

第四步:接下来会弹出N个(确实是N个)下面的菜单提示安装各个包,每次点击“Install”安装即可,直至不再弹出这个菜单

《Jupyter Notebook导出PDF时报错“nbconvert failed: xelatex not found on PATH……”的解决办法》

第五步:再次点击Download as” – “PDF via LaTeX(.pdf) ” ,此时便会在当前浏览器的下载项中导出PDF文件。

    原文作者:grandesucesso
    原文地址: https://blog.csdn.net/grandesucesso/article/details/107831868
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞