我有两个文件,分别位于不同的文件夹中。一个可以成功转换为HTML,而另一个却不能。我做错了什么吗?
一个可怕的失败。
错误消息看起来像这样。
C:\Users\rcreedon\Dropbox\GIZSupervisor\DATA\Production_Data\STP_Data\Data_Sets Wave1\1006>ipython nbconvert 1006ProdData.ipynb --to html [NbConvertApp] 使用现有的配置文件目录: u'C:\Users\rcreedon\.ipython\profile_default' [NbConvertApp] 转换笔记本 1006ProdData.ipynb 到 html [NbConvertApp] 支持文件将在 1006ProdData_files\ 中 [NbConvertApp] 加载模板 html_full.tpl [NbConvertApp] 错误 | 转换 '1006ProdData.ipynb' 时出错 Traceback (most recent call last): File "C:\Anaconda\lib\site-packages\IPython\nbconvert\nbconvertapp.py", line 200, in convert_notebooks output, resources = exporter.from_filename(notebook_filename, resources=resources) File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters\exporter.py", line 289, in from_filename return self.from_notebook_node(nbformat.read(f, 'json'), resources=resource,**kw) File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters\exporter.py", line 260, in from_notebook_node output = self.template.render(nb=nb_copy, resources=resources) File "C:\Anaconda\lib\site-packages\jinja2\environment.py", line 969, in render return self.environment.handle_exception(exc_info, True) File "C:\Anaconda\lib\site-packages\jinja2\environment.py", line 742, in handle_exception reraise(exc_type, exc_value, tb) File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\html_full.tpl", line 1, in top-level template code {%- extends 'html_basic.tpl' -%} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\html_basic.tpl", line 1, in top-level template code {%- extends 'display_priority.tpl' -%} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\skeleton\display_priority.tpl", line 1, in top-level template code {%- extends 'null.tpl' -%} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\skeleton\null.tpl", line 26, in top-level template code {%- block body -%} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\html_full.tpl", line 62, in block "body" {{ super() }} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\skeleton\null.tpl", line 29, in block "body" {%- block any_cell scoped -%} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\skeleton\null.tpl", line 76, in block "any_cell" {%- block headingcell scoped-%} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\html_basic.tpl", line 64, in block "headingcell" {{ ("#" * cell.level + cell.source) | replace('\n', ' ') | strip_math_space | markdown2html | strip_files_prefix | add_anchor }} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\filters\markdown.py", line 55, in markdown2html return pandoc(source, 'markdown', 'html', extra_args=['--mathjax']) File "C:\Anaconda\lib\site-packages\IPython\nbconvert\utils\pandoc.py", line 4, in pandoc "http://johnmacfarlane.net/pandoc/installing.html" PandocMissing: 命令 'pandoc -f markdown -t html --mathjax' 返回错误: [Error 2] 系统找不到指定的文件。 请检查 pandoc 是否已安装: http://johnmacfarlane.net/pandoc/installing.html
cd C:\Users\rcreedon\Dropbox\GIZSupervisor\DATA\Production_Data\STP_Data\Data_Sets\Wave1\1004
ipython nbconvert 1004ProdData.ipynb --to html
完全成功
文件2:
cd C:\Users\rcreedon\Dropbox\GIZSupervisor\DATA\Production_Data\STP_Data\Data_Sets\Wave1\1006
ipython nbconvert 1006prodData.ipynb --to html
一个可怕的失败。
错误消息看起来像这样。
C:\Users\rcreedon\Dropbox\GIZSupervisor\DATA\Production_Data\STP_Data\Data_Sets Wave1\1006>ipython nbconvert 1006ProdData.ipynb --to html [NbConvertApp] 使用现有的配置文件目录: u'C:\Users\rcreedon\.ipython\profile_default' [NbConvertApp] 转换笔记本 1006ProdData.ipynb 到 html [NbConvertApp] 支持文件将在 1006ProdData_files\ 中 [NbConvertApp] 加载模板 html_full.tpl [NbConvertApp] 错误 | 转换 '1006ProdData.ipynb' 时出错 Traceback (most recent call last): File "C:\Anaconda\lib\site-packages\IPython\nbconvert\nbconvertapp.py", line 200, in convert_notebooks output, resources = exporter.from_filename(notebook_filename, resources=resources) File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters\exporter.py", line 289, in from_filename return self.from_notebook_node(nbformat.read(f, 'json'), resources=resource,**kw) File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters\exporter.py", line 260, in from_notebook_node output = self.template.render(nb=nb_copy, resources=resources) File "C:\Anaconda\lib\site-packages\jinja2\environment.py", line 969, in render return self.environment.handle_exception(exc_info, True) File "C:\Anaconda\lib\site-packages\jinja2\environment.py", line 742, in handle_exception reraise(exc_type, exc_value, tb) File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\html_full.tpl", line 1, in top-level template code {%- extends 'html_basic.tpl' -%} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\html_basic.tpl", line 1, in top-level template code {%- extends 'display_priority.tpl' -%} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\skeleton\display_priority.tpl", line 1, in top-level template code {%- extends 'null.tpl' -%} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\skeleton\null.tpl", line 26, in top-level template code {%- block body -%} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\html_full.tpl", line 62, in block "body" {{ super() }} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\skeleton\null.tpl", line 29, in block "body" {%- block any_cell scoped -%} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\skeleton\null.tpl", line 76, in block "any_cell" {%- block headingcell scoped-%} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\html_basic.tpl", line 64, in block "headingcell" {{ ("#" * cell.level + cell.source) | replace('\n', ' ') | strip_math_space | markdown2html | strip_files_prefix | add_anchor }} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\filters\markdown.py", line 55, in markdown2html return pandoc(source, 'markdown', 'html', extra_args=['--mathjax']) File "C:\Anaconda\lib\site-packages\IPython\nbconvert\utils\pandoc.py", line 4, in pandoc "http://johnmacfarlane.net/pandoc/installing.html" PandocMissing: 命令 'pandoc -f markdown -t html --mathjax' 返回错误: [Error 2] 系统找不到指定的文件。 请检查 pandoc 是否已安装: http://johnmacfarlane.net/pandoc/installing.html