<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style><style type="text/css"></style><style type="text/css"></style>
</head>
<body class=" hasGoogleVoiceExt hasGoogleVoiceExt" fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<div id="divRpF661923" style="direction: ltr;"><span style="font-size: small; background-color: rgb(255, 255, 255); color: rgb(34, 34, 34); font-family: arial;">All,</span></div>
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">
<div style="color:rgb(34,34,34); font-family:arial"><font size="2"><br>
</font></div>
<div style="color:rgb(34,34,34); font-family:arial"><font size="2">I have been using nbconvert to generate HTML views of notebooks with IPython1.x.  I based my work on this: </font><a href="http://nbviewer.ipython.org/urls/raw.githubusercontent.com/ipython/ipython-in-depth/master/notebooks/07%20-%20NbConvert%20Python%20library.ipynb?create=1#Programatically-make-templates" style="font-family:Tahoma; font-size:10pt" target="_blank">http://nbviewer.ipython.org/urls/raw.githubusercontent.com/ipython/ipython-in-depth/master/notebooks/07%20-%20NbConvert%20Python%20library.ipynb?create=1#Programatically-make-templates</a></div>
<div style="color:rgb(34,34,34); font-family:arial"><font size="2"><br>
</font></div>
<div style="color:rgb(34,34,34); font-family:arial"><font size="2">This work great with IPython1.x but is now not working with IPython2.0-rc.  I am hoping you can help me sort through my errors.</font></div>
<div style="color:rgb(34,34,34); font-family:arial"><font size="2"><br>
</font></div>
<div style="color:rgb(34,34,34); font-family:arial"><font size="2">The code looks like this:</font></div>
<div style="color:rgb(34,34,34)"><font size="2" face="Courier New">extra_tpls = DictLoader({'na_full': ..., 'na_report', ...})<br>
</font></div>
<div style="color:rgb(34,34,34)">
<div><font size="2" face="Courier New">c = Config()</font></div>
<div><font size="2" face="Courier New">c.HTMLExporter.default_template = 'na_report'</font></div>
</div>
<div style="color:rgb(34,34,34)"><font size="2" face="Courier New">exportHTML = HTMLExporter(config=c, extra_loaders=[extra_tpls])<br>
</font></div>
<div style="color:rgb(34,34,34)"><font size="2" face="Courier New">exportHTML.from_notebook_node(nb)<br>
</font></div>
<div style="color:rgb(34,34,34)"><font size="2" face="Courier New"><br>
</font></div>
<div style="color:rgb(34,34,34)"><font size="2" face="arial">My DictLoader contains two templates:</font></div>
<div style="color:rgb(34,34,34)">
<ul style="font-family:arial; font-size:10pt">
<li><span style="font-family:arial; font-size:small">na_full extends html_basic.tpl</span></li><li><span style="font-family:arial; font-size:small">na_report extends display_priority.tpl</span></li></ul>
</div>
<div style="color:rgb(34,34,34); font-family:arial"><font size="2">I get errors with either template, but each template is different.</font></div>
<div style="color:rgb(34,34,34); font-family:arial"><font size="2"><br>
</font></div>
<div style="color:rgb(34,34,34); font-family:arial"><font size="2">For na_full, it looks like html_basic.tpl cannot be found:</font></div>
<div style="color:rgb(34,34,34)">
<div class="" style="min-width:11ex; padding:0px 0.4em; margin:0px; text-align:right; line-height:1.21429em; color:rgb(0,0,0)">
</div>
<div class="" style="padding:0.4em 0.4em 0px; color:rgb(0,0,0); line-height:1.21429em">
<pre style="padding:0px; margin-top:0px; margin-bottom:0px; line-height:inherit; word-break:break-all; word-wrap:break-word; white-space:pre-wrap; border:0px; vertical-align:baseline"><font size="2" face="Courier New"><span class="" style="color:rgb(139,0,0)">---------------------------------------------------------------------------</span>
<span class="" style="color:rgb(139,0,0)">TemplateNotFound</span>                          Traceback (most recent call last)
<span class="" style="color:rgb(0,100,0)"><ipython-input-23-008e826165f9></span> in <span class="" style="color:rgb(70,130,180)"><module><span class="" style="color:rgb(0,0,139)">()</span>
<span class="" style="color:rgb(0,100,0)">----> 1<span class="" style="color:rgb(165,42,42)"> </span>exportHTML</span><span class="" style="color:rgb(165,42,42)">.</span></span>from_notebook_node<span class="" style="color:rgb(165,42,42)">(</span>nb<span class="" style="color:rgb(165,42,42)">)</span><span class="" style="color:rgb(165,42,42)"></span>

<span class="" style="color:rgb(0,100,0)">/x/eng/rtpperf/python2.7-Debian-unstable-x86_64-tst/local/lib/python2.7/site-packages/IPython/nbconvert/exporters/templateexporter.pyc</span> in <span class="" style="color:rgb(70,130,180)">from_notebook_node<span class="" style="color:rgb(0,0,139)">(self, nb, resources, **kw)</span>
<span class="" style="color:rgb(0,100,0)">    213</span> <span class="" style="color:rgb(165,42,42)"></span></span>
<span class="" style="color:rgb(0,100,0)">    214</span>         <span class="" style="color:rgb(0,100,0)">if</span> self<span class="" style="color:rgb(165,42,42)">.</span>template <span class="" style="color:rgb(0,100,0)">is</span> <span class="" style="color:rgb(0,100,0)">not</span> None<span class="" style="color:rgb(165,42,42)">:</span><span class="" style="color:rgb(165,42,42)"></span>
<span class="" style="color:rgb(0,100,0)">--> 215<span class="" style="color:rgb(165,42,42)">             </span>output</span> <span class="" style="color:rgb(165,42,42)">=</span> self<span class="" style="color:rgb(165,42,42)">.</span>template<span class="" style="color:rgb(165,42,42)">.</span>render<span class="" style="color:rgb(165,42,42)">(</span>nb<span class="" style="color:rgb(165,42,42)">=</span>nb_copy<span class="" style="color:rgb(165,42,42)">,</span> resources<span class="" style="color:rgb(165,42,42)">=</span>resources<span class="" style="color:rgb(165,42,42)">)</span><span class="" style="color:rgb(165,42,42)"></span>
<span class="" style="color:rgb(0,100,0)">    216</span>         <span class="" style="color:rgb(0,100,0)">else</span><span class="" style="color:rgb(165,42,42)">:</span><span class="" style="color:rgb(165,42,42)"></span>
<span class="" style="color:rgb(0,100,0)">    217</span>             <span class="" style="color:rgb(0,100,0)">raise</span> IOError<span class="" style="color:rgb(165,42,42)">(</span><span class="" style="color:rgb(0,0,139)">'template file "%s" could not be found'</span> <span class="" style="color:rgb(165,42,42)">%</span> self<span class="" style="color:rgb(165,42,42)">.</span>template_file<span class="" style="color:rgb(165,42,42)">)</span><span class="" style="color:rgb(165,42,42)"></span>

<span class="" style="color:rgb(0,100,0)">/x/eng/rtpperf/python2.7-Debian-unstable-x86_64-tst/local/lib/python2.7/site-packages/jinja2/environment.pyc</span> in <span class="" style="color:rgb(70,130,180)">render<span class="" style="color:rgb(0,0,139)">(self, *args, **kwargs)</span>
<span class="" style="color:rgb(0,100,0)">    967</span>         <span class="" style="color:rgb(0,100,0)">except</span> </span>Exception<span class="" style="color:rgb(165,42,42)">:</span><span class="" style="color:rgb(165,42,42)"></span>
<span class="" style="color:rgb(0,100,0)">    968</span>             exc_info <span class="" style="color:rgb(165,42,42)">=</span> sys<span class="" style="color:rgb(165,42,42)">.</span>exc_info<span class="" style="color:rgb(165,42,42)">(</span><span class="" style="color:rgb(165,42,42)">)</span><span class="" style="color:rgb(165,42,42)"></span>
<span class="" style="color:rgb(0,100,0)">--> 969<span class="" style="color:rgb(165,42,42)">         <span class="" style="color:rgb(0,100,0)">return</span> </span>self</span><span class="" style="color:rgb(165,42,42)">.</span>environment<span class="" style="color:rgb(165,42,42)">.</span>handle_exception<span class="" style="color:rgb(165,42,42)">(</span>exc_info<span class="" style="color:rgb(165,42,42)">,</span> True<span class="" style="color:rgb(165,42,42)">)</span><span class="" style="color:rgb(165,42,42)"></span>
<span class="" style="color:rgb(0,100,0)">    970</span> <span class="" style="color:rgb(165,42,42)"></span>
<span class="" style="color:rgb(0,100,0)">    971</span>     <span class="" style="color:rgb(0,100,0)">def</span> stream<span class="" style="color:rgb(165,42,42)">(</span>self<span class="" style="color:rgb(165,42,42)">,</span> <span class="" style="color:rgb(165,42,42)">*</span>args<span class="" style="color:rgb(165,42,42)">,</span> <span class="" style="color:rgb(165,42,42)">**</span>kwargs<span class="" style="color:rgb(165,42,42)">)</span><span class="" style="color:rgb(165,42,42)">:</span><span class="" style="color:rgb(165,42,42)"></span>

<span class="" style="color:rgb(0,100,0)">/x/eng/rtpperf/python2.7-Debian-unstable-x86_64-tst/local/lib/python2.7/site-packages/jinja2/environment.pyc</span> in <span class="" style="color:rgb(70,130,180)">handle_exception<span class="" style="color:rgb(0,0,139)">(self, exc_info, rendered, source_hint)</span>
<span class="" style="color:rgb(0,100,0)">    740</span>             </span>self<span class="" style="color:rgb(165,42,42)">.</span>exception_handler<span class="" style="color:rgb(165,42,42)">(</span>traceback<span class="" style="color:rgb(165,42,42)">)</span><span class="" style="color:rgb(165,42,42)"></span>
<span class="" style="color:rgb(0,100,0)">    741</span>         exc_type<span class="" style="color:rgb(165,42,42)">,</span> exc_value<span class="" style="color:rgb(165,42,42)">,</span> tb <span class="" style="color:rgb(165,42,42)">=</span> traceback<span class="" style="color:rgb(165,42,42)">.</span>standard_exc_info<span class="" style="color:rgb(165,42,42)"></span>
<span class="" style="color:rgb(0,100,0)">--> 742<span class="" style="color:rgb(165,42,42)">         </span>reraise</span><span class="" style="color:rgb(165,42,42)">(</span>exc_type<span class="" style="color:rgb(165,42,42)">,</span> exc_value<span class="" style="color:rgb(165,42,42)">,</span> tb<span class="" style="color:rgb(165,42,42)">)</span><span class="" style="color:rgb(165,42,42)"></span>
<span class="" style="color:rgb(0,100,0)">    743</span> <span class="" style="color:rgb(165,42,42)"></span>
<span class="" style="color:rgb(0,100,0)">    744</span>     <span class="" style="color:rgb(0,100,0)">def</span> join_path<span class="" style="color:rgb(165,42,42)">(</span>self<span class="" style="color:rgb(165,42,42)">,</span> template<span class="" style="color:rgb(165,42,42)">,</span> parent<span class="" style="color:rgb(165,42,42)">)</span><span class="" style="color:rgb(165,42,42)">:</span><span class="" style="color:rgb(165,42,42)"></span>

<span class="" style="color:rgb(0,100,0)"><template></span> in <span class="" style="color:rgb(70,130,180)">top-level template code<span class="" style="color:rgb(0,0,139)">()</span>

<span class="" style="color:rgb(139,0,0)">TemplateNotFound</span>: html_basic.tpl</span></font></pre>
</div>
</div>
<div style="color:rgb(34,34,34); font-family:arial"><font size="2"><br>
</font></div>
<div style="color:rgb(34,34,34)"><font size="2" style="font-family:arial">For na_report, it looks like that it is not being found:<br class="">
</font>
<div class="" style="font-family:monospace; min-width:11ex; padding:0px 0.4em; margin:0px; text-align:right; line-height:1.21429em; color:rgb(0,0,0)">
</div>
<div class="" style="padding:0.4em 0.4em 0px; color:rgb(0,0,0); line-height:1.21429em">
<pre style="padding:0px; margin-top:0px; margin-bottom:0px; line-height:inherit; word-break:break-all; word-wrap:break-word; white-space:pre-wrap; border:0px; vertical-align:baseline"><font size="2"><font face="Courier New"><span class="" style="color:rgb(139,0,0)">---------------------------------------------------------------------------</span>
<span class="" style="color:rgb(139,0,0)">IOError</span>                                   Traceback (most recent call last)
<span class="" style="color:rgb(0,100,0)"><ipython-input-20-008e826165f9></span> in <span class="" style="color:rgb(70,130,180)"><module><span class="" style="color:rgb(0,0,139)">()</span>
<span class="" style="color:rgb(0,100,0)">----> 1<span class="" style="color:rgb(165,42,42)"> </span>exportHTML</span><span class="" style="color:rgb(165,42,42)">.</span></span>from_notebook_node<span class="" style="color:rgb(165,42,42)">(</span>nb<span class="" style="color:rgb(165,42,42)">)</span><span class="" style="color:rgb(165,42,42)"></span>

<span class="" style="color:rgb(0,100,0)">/x/eng/rtpperf/python2.7-Debian-unstable-x86_64-tst/local/lib/python2.7/site-packages/IPython/nbconvert/exporters/templateexporter.pyc</span> in <span class="" style="color:rgb(70,130,180)">from_notebook_node<span class="" style="color:rgb(0,0,139)">(self, nb, resources, **kw)</span>
<span class="" style="color:rgb(0,100,0)">    215</span>             </span>output <span class="" style="color:rgb(165,42,42)">=</span> self<span class="" style="color:rgb(165,42,42)">.</span>template<span class="" style="color:rgb(165,42,42)">.</span>render<span class="" style="color:rgb(165,42,42)">(</span>nb<span class="" style="color:rgb(165,42,42)">=</span>nb_copy<span class="" style="color:rgb(165,42,42)">,</span> resources<span class="" style="color:rgb(165,42,42)">=</span>resources<span class="" style="color:rgb(165,42,42)">)</span><span class="" style="color:rgb(165,42,42)"></span>
<span class="" style="color:rgb(0,100,0)">    216</span>         <span class="" style="color:rgb(0,100,0)">else</span><span class="" style="color:rgb(165,42,42)">:</span><span class="" style="color:rgb(165,42,42)"></span>
<span class="" style="color:rgb(0,100,0)">--> 217<span class="" style="color:rgb(165,42,42)">             <span class="" style="color:rgb(0,100,0)">raise</span> </span>IOError</span><span class="" style="color:rgb(165,42,42)">(</span><span class="" style="color:rgb(0,0,139)">'template file "%s" could not be found'</span> <span class="" style="color:rgb(165,42,42)">%</span> self<span class="" style="color:rgb(165,42,42)">.</span>template_file<span class="" style="color:rgb(165,42,42)">)</span><span class="" style="color:rgb(165,42,42)"></span>
<span class="" style="color:rgb(0,100,0)">    218</span>         <span class="" style="color:rgb(0,100,0)">return</span> output<span class="" style="color:rgb(165,42,42)">,</span> resources<span class="" style="color:rgb(165,42,42)"></span>
<span class="" style="color:rgb(0,100,0)">    219</span> <span class="" style="color:rgb(165,42,42)"></span>

<span class="" style="color:rgb(139,0,0)">IOError</span>: template file "html_na_report" could not be found</font><font face="Helvetica Neue, Helvetica, Arial, sans-serif">
</font></font></pre>
<div style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif"><font size="2"><br>
</font></div>
<div style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif"><font size="2">I have also tried using the FileSystemLoader from jinja2 as well.  It loads the templates and I get the same errors.</font></div>
<div style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif"><font size="2"><br>
</font></div>
<div style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif"><font size="2">Thanks for your help,</font></div>
<div style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif"><font size="2">Zach Jones</font></div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">var new_nav = new function() {};var x;var old_navigator = window.navigator;for (x in navigator) {if (typeof navigator[x] == 'function') {eval("new_nav." + x + " = function() { return old_navigator." + x + "();};");} else {eval("new_nav." + x + " = navigator." + x + ";");}}new_nav.userAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120427 Firefox/15.0a1";new_nav.vendor = "Mozilla, Inc.";window.navigator = new_nav;</script><script type="text/javascript">var new_nav = new function() {};var x;var old_navigator = window.navigator;for (x in navigator) {if (typeof navigator[x] == 'function') {eval("new_nav." + x + " = function() { return old_navigator." + x + "();};");} else {eval("new_nav." + x + " = navigator." + x + ";");}}new_nav.userAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120427 Firefox/15.0a1";new_nav.vendor = "Mozilla, Inc.";window.navigator = new_nav;</script>
</body>
</html>