组织Babel Shell块无法执行jupyter nbconvert

时间:2018-07-18 17:20:21

标签: jupyter-notebook org-mode org-babel nbconvert

我正在尝试从组织文件中执行一些shell代码

#+BEGIN_SRC bash
cd ~/work/repo
jupyter nbconvert notebook.ipynb
#+END_SRC

我得到以下回溯:

    Traceback (most recent call last):
  File "/usr/local/bin/jupyter-nbconvert", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/nbconvertapp.py", line 325, in start
    self.convert_notebooks()
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/nbconvertapp.py", line 483, in convert_notebooks
    self.exporter = cls(config=self.config)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/templateexporter.py", line 243, in __init__
    super(TemplateExporter, self).__init__(config=config, **kw)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/exporter.py", line 105, in __init__
    self._init_preprocessors()
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/exporter.py", line 259, in _init_preprocessors
    self.register_preprocessor(preprocessor, enabled=True)
  File "/usr/local/lib/python2.7/dist-packages/nbconvert/exporters/exporter.py", line 220, in register_preprocessor
    preprocessor_cls = import_item(preprocessor)
  File "/usr/local/lib/python2.7/dist-packages/traitlets/utils/importstring.py", line 34, in import_item
    module = __import__(package, fromlist=[obj])
ImportError: No module named jupyter_contrib_nbextensions.nbconvert_support

相同的代码直接在我的终端上工作。

从org babel块执行一些检查:

echo $0
which python
which jupyter

假设我使用的是相同的shell(bash),python在/ usr / bin / python中,而jupyter在/ usr / local / bin / jupyter中。

在所有这些中,我都没有使用过任何conda环境。

任何想法为何我的jupyter nbconvert在我的组织块中的表现与在终端中的表现不一样?

0 个答案:

没有答案