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.

30 Likes

We just released nbdev. Hereā€™s the release post:

22 Likes

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>
    sys.exit(nbdev_build_docs())
  File "/home/mnpinto/anaconda3/lib/python3.6/site-packages/fastscript/fastscript.py", line 42, in _f
    func(**args.__dict__)
  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.

2 Likes

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.

2 Likes

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!

14 Likes

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.

image

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.)

3 Likes

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.

2 Likes

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: