0

我正在使用 linux 并尝试按照此处的说明将.ipynb文件转换为.pdf

但我收到以下错误

ipython nbconvert notebook_file.ipynb --to latex --post PDF但我收到以下错误

[NbConvertApp] Using existing profile dir: u'/home/user/.ipython/profile_default'
Traceback (most recent call last):
  File "/usr/bin/ipython", line 5, in <module>
    start_ipython()
  File "/usr/lib/python2.7/dist-packages/IPython/__init__.py", line 120, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 565, in launch_instance
    app.start()
  File "/usr/lib/python2.7/dist-packages/IPython/terminal/ipapp.py", line 367, in start
    return self.subapp.start()
  File "/usr/lib/python2.7/dist-packages/IPython/nbconvert/nbconvertapp.py", line 268, in start
    self.convert_notebooks()
  File "/usr/lib/python2.7/dist-packages/IPython/nbconvert/nbconvertapp.py", line 284, in convert_notebooks
    exporter = exporter_map[self.export_format](config=self.config)
  File "/usr/lib/python2.7/dist-packages/IPython/nbconvert/exporters/templateexporter.py", line 154, in __init__
    self._init_template()
  File "/usr/lib/python2.7/dist-packages/IPython/nbconvert/exporters/templateexporter.py", line 272, in _init_template
    self._template_file_changed('template_file', self.template_file, self.template_file)
  File "/usr/lib/python2.7/dist-packages/IPython/nbconvert/exporters/templateexporter.py", line 97, in _template_file_changed
    self._load_template()
  File "/usr/lib/python2.7/dist-packages/IPython/nbconvert/exporters/templateexporter.py", line 167, in _load_template
    from jinja2 import TemplateNotFound
ImportError: No module named jinja2

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

然后我尝试使用以下命令转换为默认的 html 格式

ipython nbconvert notebook_file.ipynb

然后我收到以下错误

[NbConvertApp] Using existing profile dir: u'/home/user/.ipython/profile_default'
Traceback (most recent call last):
  File "/usr/bin/ipython", line 5, in <module>
    start_ipython()
  File "/usr/lib/python2.7/dist-packages/IPython/__init__.py", line 120, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 565, in launch_instance
    app.start()
  File "/usr/lib/python2.7/dist-packages/IPython/terminal/ipapp.py", line 367, in start
    return self.subapp.start()
  File "/usr/lib/python2.7/dist-packages/IPython/nbconvert/nbconvertapp.py", line 268, in start
    self.convert_notebooks()
  File "/usr/lib/python2.7/dist-packages/IPython/nbconvert/nbconvertapp.py", line 284, in convert_notebooks
    exporter = exporter_map[self.export_format](config=self.config)
  File "/usr/lib/python2.7/dist-packages/IPython/nbconvert/exporters/templateexporter.py", line 151, in __init__
    super(TemplateExporter, self).__init__(config=config, **kw)
  File "/usr/lib/python2.7/dist-packages/IPython/nbconvert/exporters/exporter.py", line 94, in __init__
    self._init_preprocessors()
  File "/usr/lib/python2.7/dist-packages/IPython/nbconvert/exporters/exporter.py", line 222, in _init_preprocessors
    self.register_preprocessor(preprocessor)
  File "/usr/lib/python2.7/dist-packages/IPython/nbconvert/exporters/exporter.py", line 188, in register_preprocessor
    return self.register_preprocessor(preprocessor_cls, enabled)
  File "/usr/lib/python2.7/dist-packages/IPython/nbconvert/exporters/exporter.py", line 201, in register_preprocessor
    self.register_preprocessor(preprocessor(parent=self), enabled)
  File "/usr/lib/python2.7/dist-packages/IPython/nbconvert/preprocessors/csshtmlheader.py", line 54, in __init__
    self._regen_header()
  File "/usr/lib/python2.7/dist-packages/IPython/nbconvert/preprocessors/csshtmlheader.py", line 90, in _regen_header
    from IPython.html import DEFAULT_STATIC_FILES_PATH
ImportError: No module named html

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

我已经尝试了所有可能的选择,但都是徒劳的

我错过了什么???

提前致谢...

4

0 回答 0