Nbdev_build_docs causes AttributeError: 'str' object has no attribute 'items'

I’m getting started with nbdev and haven’t changed much except the required changes. Just got my build passing on GitHub and was trying to build docs. I’ve changed the Source in the Setttings to docs folder as instructed. The sequence of commands I ran was as follows:

nbdev_build_lib
nbdev_clean_nbs
nbdev_build_docs

First 2 commands run successfully while the build_docs causes following error:

converting: /home/kshitij/git/fast_impl/nbs/00_core.ipynb
converting: /home/kshitij/git/fast_impl/nbs/index.ipynb
converting /home/kshitij/git/fast_impl/nbs/index.ipynb to README.md
Traceback (most recent call last):
  File "/home/kshitij/anaconda3/envs/fastai2/bin/nbdev_build_docs", line 8, in <module>
    sys.exit(nbdev_build_docs())
  File "/home/kshitij/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastscript/core.py", line 73, in _f
    func(**args.__dict__)
  File "/home/kshitij/anaconda3/envs/fastai2/lib/python3.7/site-packages/nbdev/cli.py", line 103, in nbdev_build_docs
    if mk_readme: make_readme()
  File "/home/kshitij/anaconda3/envs/fastai2/lib/python3.7/site-packages/nbdev/cli.py", line 86, in make_readme
    convert_md(index_fn, Config().config_file.parent, jekyll=False)
  File "/home/kshitij/anaconda3/envs/fastai2/lib/python3.7/site-packages/nbdev/export2html.py", line 473, in convert_md
    for n,o in export[1]['outputs'].items():
AttributeError: 'str' object has no attribute 'items'

I’ve also executed nbdev_install_git_hooks (if that’s related to the issue)

@lgvaz any thoughts on this? I’ve closely followed fastcook to get started with nbdev, but not sure what this error says.

Is your repo public? I could try cloning and building the docs here to see if I can reproduce the error

1 Like

Thanks for the quick reply! Yes it is public, here is the link

You just need to add another text cell after the title in index.ipynb.

It has to contain some text, cannot be empty.

Thanks! it worked :smiley:

I tried adding a cell with #hide tag but that too was throwing same error, so after removing #hide as well, it worked.