升级后的Anaconda Ipython套装,不再能够运行NBConvert

时间:2015-04-04 09:22:28

标签: ipython ipython-notebook

PATH看起来像这样,我做错了什么?已使用Windows MSI安装Pywin32Pandoc

C:\Users\AliDesktop\Anaconda;C:\Users\AliDesktop\Anaconda\Scripts;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files (x86)\Graphviz2.38\bin\;C:\Users\AliDesktop\AppData\Local\Pandoc\

我试图运行我经常运行的命令时得到这个:

ipython nbconvert --to latex --post PDF .ipynb 
C:\Users\AliDesktop\Desktop\Magic Briefcase\School\1\1- Intro to Data Science\le
cture\Summaries\IPython Notebooks>ipython nbconvert --to latex --post PDF .ipynb

以下是我的错误追溯:

Traceback (most recent call last):
  File "C:\Users\AliDesktop\Anaconda\lib\runpy.py", line 162, in _run_module_as_
main
    "__main__", fname, loader, pkg_name)
  File "C:\Users\AliDesktop\Anaconda\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Users\AliDesktop\Anaconda\Scripts\ipython.exe\__main__.py", line 9, i
n <module>
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\__init__.py", lin
e 120, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\config\applicatio
n.py", line 573, in launch_instance
    app.initialize(argv)
  File "<string>", line 2, in initialize
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\config\applicatio
n.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\terminal\ipapp.py
", line 321, in initialize
    super(TerminalIPythonApp, self).initialize(argv)
  File "<string>", line 2, in initialize
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\config\applicatio
n.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\core\application.
py", line 369, in initialize
    self.parse_command_line(argv)
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\terminal\ipapp.py
", line 316, in parse_command_line
    return super(TerminalIPythonApp, self).parse_command_line(argv)
  File "<string>", line 2, in parse_command_line
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\config\applicatio
n.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\config\applicatio
n.py", line 471, in parse_command_line
    return self.initialize_subcommand(subc, subargv)
  File "<string>", line 2, in initialize_subcommand
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\config\applicatio
n.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\config\applicatio
n.py", line 409, in initialize_subcommand
    self.subapp.initialize(argv)
  File "<string>", line 2, in initialize
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\config\applicatio
n.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\nbconvert\nbconve
rtapp.py", line 211, in initialize
    super(NbConvertApp, self).initialize(argv)
  File "<string>", line 2, in initialize
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\config\applicatio
n.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\core\application.
py", line 369, in initialize
    self.parse_command_line(argv)
  File "<string>", line 2, in parse_command_line
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\config\applicatio
n.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\config\applicatio
n.py", line 495, in parse_command_line
    self.update_config(config)
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\config\applicatio
n.py", line 394, in update_config
    self.config = newconfig
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\utils\traitlets.p
y", line 445, in __set__
    obj._notify_trait(self.name, old_value, new_value)
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\utils\traitlets.p
y", line 602, in _notify_trait
    c(name, old_value, new_value)
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\config\applicatio
n.py", line 241, in _config_changed
    SingletonConfigurable._config_changed(self, name, old, new)
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\config\configurab
le.py", line 159, in _config_changed
    self._load_config(new, traits=traits, section_names=section_names)
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\config\configurab
le.py", line 143, in _load_config
    setattr(self, name, deepcopy(config_value))
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\utils\traitlets.p
y", line 445, in __set__
    obj._notify_trait(self.name, old_value, new_value)
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\utils\traitlets.p
y", line 602, in _notify_trait
    c(name, old_value, new_value)
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\nbconvert\nbconve
rtapp.py", line 193, in _postprocessor_class_changed
    self.postprocessor_factory = import_item(new)
  File "C:\Users\AliDesktop\Anaconda\lib\site-packages\IPython\utils\importstrin
g.py", line 50, in import_item
    return __import__(parts[0])
ImportError: No module named PDF

1 个答案:

答案 0 :(得分:1)

选项--to latex --post PDF已被--to pdf中的IPython >= 3.0取代。所以这应该有效:

ipython nbconvert --to pdf </path/to/notebook> 

有关详细信息,请参阅github上的问题#7973