每当我尝试将 Jupyter 笔记本导出为 PDF 时,我都会在单独的窗口中收到以下错误:
500 : Internal Server Error
The error was:
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.
我正在运行 macOS Sierra 10.12.6。
我尝试过的事情:
- 通过 pip(在 Jupyter 笔记本中)和 conda(终端)重新安装 nbconvert
- 为 Mac 安装 xelatex
- 重新安装 Mactex
- 安装 pandoc(通过 pip 和“conda install -c conda-forge pandoc”)
跑步
!echo $PATH
产量:
/Users/ed/anaconda/bin:/Users/ed/anaconda/bin:/usr/bin:/bin:/usr/sbin:/sbin
根据@einsweniger 的建议,我在这里找到了包含 xelatex 的目录:/usr/local/texlive/bin/x86_64-darwin。我将 XeLatex 复制并粘贴到上面的 bin 目录中,并得到一个新错误:
```nbconvert failed: PDF creating failed, captured latex output:
warning: kpathsea: configuration file texmf.cnf not found in these directories: /Users/e/anaconda/bin:/Users/ed/anaconda/bin/share/texmf-local/web2c:/Users/ed/anaconda/bin/share/texmf-dist/web2c:/Users/ed/anaconda/bin/share/texmf/web2c:/Users/ed/anaconda/bin/texmf-local/web2c:/Users/ed/anaconda/bin/texmf-dist/web2c:/Users/ed/anaconda/bin/texmf/web2c:/Users/ed/anaconda:/Users/edefilippis/anaconda/share/texmf-local/web2c:/Users/e/anaconda/share/texmf-dist/web2c:/Users/ed/anaconda/share/texmf/web2c:/Users/ed/anaconda/texmf-
This is XeTeX, Version 3.14159265-2.6-0.99999 (TeX Live 2018) (preloaded format=xelatex)
kpathsea: Running mktexfmt xelatex.fmt
I can't find the format file `xelatex.fmt'!
```
我还将 xelatex.fmt 放在目录中,但仍然出现错误。