每當(dāng)我嘗試將 Jupyter 筆記本導(dǎo)出為 PDF 時(shí),我都會(huì)在單獨(dú)的窗口中收到以下錯(cuò)誤:500 : Internal Server ErrorThe 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.我正在運(yùn)行 macOS Sierra 10.12.6。我嘗試過的事情:通過 pip(在 Jupyter notebook 中)和 conda(終端)重新安裝 nbconvert為 Mac 安裝 xelatex重新安裝 Mactex安裝 pandoc(通過 pip 和“conda install -c conda-forge pandoc”)跑步!echo $PATH產(chǎn)量:/Users/ed/anaconda/bin:/Users/ed/anaconda/bin:/usr/bin:/bin:/usr/sbin:/sbin我根據(jù)@einsweniger 的建議在此處找到了包含 xelatex 的目錄:/usr/local/texlive/bin/x86_64-darwin。我把XeLatex復(fù)制粘貼到上面的bin目錄下,出現(xiàn)新錯(cuò)誤:```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.fmtI can't find the format file `xelatex.fmt'!```我還將 xelatex.fmt 放在目錄中,但仍然出現(xiàn)錯(cuò)誤。
3 回答

ABOUTYOU
TA貢獻(xiàn)1812條經(jīng)驗(yàn) 獲得超5個(gè)贊
我不習(xí)慣 Mac 安裝路徑,根據(jù)basictex faq所說,我認(rèn)為可執(zhí)行文件應(yīng)該存在于在終端中/usr/local/texlive/bin/x86_64-darwin 運(yùn)行which xelatex也可能有助于查找命令所在的位置,但這僅在目錄已在您的 PATH 變量中時(shí)才有效.
find / -name 'xelatex'如果它不在您的 PATH 中,則會(huì)運(yùn)行另一種方法,因此您可能會(huì)以這種方式找到它(可能需要一段時(shí)間,因?yàn)檫@會(huì)搜索整個(gè)硬盤驅(qū)動(dòng)器)。
找到它并將路徑添加到 PATH 變量后,您還應(yīng)該通過運(yùn)行檢查 jupyter 是否具有正確的 PATH
import os
print(os.environ['PATH'])
筆記本內(nèi)。
添加回答
舉報(bào)
0/150
提交
取消