IPython nbconvert 错误 (ipynb 转 pdf)

1 投票
1 回答
919 浏览
提问于 2025-04-28 10:16

看起来好像缺少了什么,但没有提供更多的信息。有没有人能给点提示呢?

这个命令是:ipython nbconvert --to latex --post pdf Week_Report_2014-10-19.ipynb

输出的信息如下。非常感谢!

[NbConvertApp] Using existing profile dir: u'/Users/elsdrm/.ipython/profile_default'
[NbConvertApp] Converting notebook Week_Report_2014-10-19.ipynb to latex
[NbConvertApp] Support files will be in Week_Report_2014-10-19_files/
[NbConvertApp] Loaded template article.tplx
[NbConvertApp] Writing 13726 bytes to Week_Report_2014-10-19.tex
[NbConvertApp] Building PDF
[NbConvertApp] Running pdflatex 3 times: [u'pdflatex', u'Week_Report_2014-10-19.tex']
Traceback (most recent call last):
  File "/usr/local/bin/ipython", line 11, in <module>
    sys.exit(start_ipython())
  File "/Library/Python/2.7/site-packages/IPython/__init__.py", line 120, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/Library/Python/2.7/site-packages/IPython/config/application.py", line 564, in launch_instance
    app.start()
  File "/Library/Python/2.7/site-packages/IPython/terminal/ipapp.py", line 367, in start
    return self.subapp.start()
  File "/Library/Python/2.7/site-packages/IPython/nbconvert/nbconvertapp.py", line 268, in start
    self.convert_notebooks()
  File "/Library/Python/2.7/site-packages/IPython/nbconvert/nbconvertapp.py", line 311, in convert_notebooks
    self.postprocessor(write_resultes)
  File "/Library/Python/2.7/site-packages/IPython/nbconvert/postprocessors/base.py", line 28, in __call__
    self.postprocess(input)
  File "/Library/Python/2.7/site-packages/IPython/nbconvert/postprocessors/pdf.py", line 140, in postprocess
    cont = self.run_latex(filename)
  File "/Library/Python/2.7/site-packages/IPython/nbconvert/postprocessors/pdf.py", line 104, in run_latex
    self.latex_count, log_error)
  File "/Library/Python/2.7/site-packages/IPython/nbconvert/postprocessors/pdf.py", line 84, in run_command
    p = subprocess.Popen(command, stdout=stdout, stdin=null)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 709, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1326, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@scipy.org
You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.
Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    c.Application.verbose_crash=True
暂无标签

1 个回答

1

既然错误发生在 pdflatex 这个阶段,也就是从 tex 文件转换成 pdf 文件的过程中,你有没有安装 pdflatex 或者其他的 latex 编译器呢?看起来 .tex 文件生成得很成功,但 .pdf 文件却没有生成。

撰写回答