Nbdev discussion

This was the thread we used for discussing nbdev before it had its own category. Please create new topics for new questions/posts now.


We just released nbdev. Here’s the release post:


This is great, I can’t wait to start using it on my projects, it will be really useful!

I’ve created a repo from the template and I’m starting to try the functionalities but I’m getting the following error when running nbdev_build_docs, is this a bug or something I’m missing? Thanks!

Traceback (most recent call last):
  File "/home/mnpinto/anaconda3/bin/nbdev_build_docs", line 11, in <module>
  File "/home/mnpinto/anaconda3/lib/python3.6/site-packages/fastscript/fastscript.py", line 42, in _f
  File "/home/mnpinto/anaconda3/lib/python3.6/site-packages/nbdev/cli.py", line 150, in nbdev_build_docs
    if mk_readme: make_readme()
  File "/home/mnpinto/anaconda3/lib/python3.6/site-packages/nbdev/cli.py", line 137, in make_readme
    convert_md(index_fn, Config().config_file.parent, jekyll=False)
  File "/home/mnpinto/anaconda3/lib/python3.6/site-packages/nbdev/export2html.py", line 405, in convert_md
    f.write(exp.from_notebook_node(nb, resources=meta_jekyll)[0])
  File "/home/mnpinto/anaconda3/lib/python3.6/site-packages/nbconvert/exporters/templateexporter.py", line 295, in from_notebook_node
    output = self.template.render(nb=nb_copy, resources=resources)
  File "/home/mnpinto/anaconda3/lib/python3.6/site-packages/nbconvert/exporters/templateexporter.py", line 111, in template
    self._template_cached = self._load_template()
  File "/home/mnpinto/anaconda3/lib/python3.6/site-packages/nbconvert/exporters/templateexporter.py", line 266, in _load_template
    return self.environment.get_template(template_file)
  File "/home/mnpinto/anaconda3/lib/python3.6/site-packages/jinja2/environment.py", line 830, in get_template
    return self._load_template(name, self.make_globals(globals))
  File "/home/mnpinto/anaconda3/lib/python3.6/site-packages/jinja2/environment.py", line 804, in _load_template
    template = self.loader.load(self, name, globals)
  File "/home/mnpinto/anaconda3/lib/python3.6/site-packages/jinja2/loaders.py", line 408, in load
    raise TemplateNotFound(name)
jinja2.exceptions.TemplateNotFound: md.tpl

Was going to type the same thing, I run into the same issue !

This should be fixed by the v0.1.3 release of this morning, or making a developer install.


Thanks, with the developer install it works.

Ah yes, v0.1.3 didn’t have the files cause I made a typo. Fixed and re-released so v0.1.4 should have all the files.

1 Like

Posted this on Twitter … but I’d love to see a video walk-through of how y’all configured and started developing v2 using nbdev (similar to the walk-thrus done over the past few months).

Thanks much.


From release post:

The point of NBEnv is to bring the key benefits of IDE/editor development into the notebook system, so you can work in notebooks without compromise for the entire lifecycle.

Is this a typo? Is “NBEnv” supposed to be “nbdev”? If not, what does NBEnv refer to in this context?

Note that we’re only using nbdev just now, since before it was part of fastai v2 (and the videos Jeremy did as a walk-through). Not much has changed except we made it an independent package and easier to use.

1 Like

Yes - fixed now. Thanks for letting us know.

1 Like

I’ll be doing a video walk-thru soon of creating a project with nbdev - although it’ll be something much simpler than fastai v2!


Sounds great! Very interesting work! Looking forward to your walk-thru!

Thanks for everything :+1: :smile: Loving the course information and videos.

Thanks for great cool tools. I’m so excited now.

I’m new to not just nbdev but github, so I have a question about README.

Is there any nbdev’s way to depict plotting image in README? Because I got stuck in following situation where plotting png appears in jupyter, but not in README.


for beginners editing settings.ini for nbdev:

  • the commented-out lines from “lib_name” down to “audience” and “language” should be uncommented and have reasonable values

Otherwise nbdev_build_lib will throw an error in regards to lib_path, which is the 2nd to last line referencing lib_name.

(The last two lines of settings.ini should not be changed by beginners. I was going to ask here for a solution to the error message "
configparser.InterpolationMissingOptionError: Bad value substitution: option ‘lib_path’ in section ‘DEFAULT’ contains an interpolation key ‘lib_name’ which is not a valid option name. Raw value: ‘%(lib_name)s’
" but found the solution while asking the question.)


How can I initialize nbdev in a repo that I already started and already has some notebooks?

A PR with a minor fix to correct source link to repo of a user, not fastai.

1 Like

here is to praying that this plays nicely with MLFLow

Thanks for this work fastAi team!!! I loved the D. Knuth books, even though I didn’t understand all of the material, I still learned a lot from his works.

Looking forward to tutorial videos and more example code/projects built using this. :slight_smile: