欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Jupyter Notebook 转pdf 错误

程序员文章站 2022-05-28 11:15:53
...

nbconvert failed: PDF creating failed, captured latex output:
This is XeTeX, Version 3.14159265-2.6-0.99999 (TeX Live 2018/W32TeX) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
! Undefined control sequence.
<> .\notebook
.tex
?
! Emergency stop.
<
> .\notebook
.tex
No pages of output.
Transcript written on ?.

解决方法:
1、如果文件路径有带中文,将中文去掉
2、找到安装路径下的pdf.py 文件打开
即…\site-packages\nbconvert\exporters\pdf.py

#writer = Instance("nbconvert.writers.FilesWriter", args=(), kw={'build_directory': '.'})
writer = Instance("nbconvert.writers.FilesWriter", args=(), kw={'build_directory': ''})

'build_directory': '.' 改为 'build_directory': ''

参考答案:GitHub