我在两个文件夹中有两个 ipynb 文件。一旦转换没问题,其他就不会转换了。难道我做错了什么?我正在转换为 html
文件1:
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] Using existing profile dir: u'C:\Users\rcreedon\.ipython\pro ile_default' [NbConvertApp] Converting notebook 1006ProdData.ipynb to html [NbConvertApp] Support files will be in 1006ProdData_files\ [NbConvertApp] Loaded template html_full.tpl [NbConvertApp] ERROR | Error while converting '1006ProdData.ipynb' Traceback (most recent call last): File "C:\Anaconda\lib\site-packages\IPython\nbconvert\nbconvertapp.py", line 00, in convert_notebooks output, resources = exporter.from_filename(notebook_filename, resources=res urces) 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 rend r return self.environment.handle_exception(exc_info, True) File "C:\Anaconda\lib\site-packages\jinja2\environment.py", line 742, in hand e_exception reraise(exc_type, exc_value, tb) File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\ tml_full.tpl", line 1, in top-level template code {%- extends 'html_basic.tpl' -%} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\ tml_basic.tpl", line 1, in top-level template code {%- extends 'display_priority.tpl' -%} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\ keleton\display_priority.tpl", line 1, in top-level template code {%- extends 'null.tpl' -%} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\ keleton\null.tpl", line 26, in top-level template code {%- block body -%} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\ tml_full.tpl", line 62, in block "body" {{ super() }} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\ keleton\null.tpl", line 29, in block "body" {%- block any_cell scoped -%} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\ keleton\null.tpl", line 76, in block "any_cell" {%- block headingcell scoped-%} File "C:\Anaconda\lib\site-packages\IPython\nbconvert\exporters..\templates\ tml_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", l ne 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: The command 'pandoc -f markdown -t html --mathjax' returned an e ror: [Error 2] The system cannot find the file specified. Please check that pandoc is installed: http://johnmacfarlane.net/pandoc/installing.html
最佳答案
不确定这是否仍然有效,但是通过将 cabal 二进制路径(例如 $HOME/.cabal/bin
)添加到 bash 为我解决了一个非常类似的问题$PATH
.
关于ipython - 转换 Ipython 笔记本时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19519008/