[Solved] Nbdev_preview results in AttributeError

I am running development libraries (from source) of fastai, fastcore, and nbdev:

nbdev - 2.3.8
fastcore - 1.5.28
fastai - 2.7.10

I followed the steps outlined here to install them: fastai - Pull requests made easy

I am developing my own library for work, and all the other commands like nbdev_export and nbdev_prepare work well

but when I try to preview the docs with nbdev_preview, I get the following error:

Traceback (most recent call last):
  File "/home/samsepiol/mambaforge/envs/auto-ob/bin/nbdev_filter", line 33, in <module>
    sys.exit(load_entry_point('nbdev', 'console_scripts', 'nbdev_filter')())
  File "/home/samsepiol/repos/fastai-libs/fastcore/fastcore/script.py", line 119, in _f
    return tfunc(**merge(args, args_from_prog(func, xtra)))
  File "/home/samsepiol/repos/fastai-libs/nbdev/nbdev/cli.py", line 46, in nbdev_filter
    with redirect_stdout(dn): filt(nb)
  File "/home/samsepiol/repos/fastai-libs/nbdev/nbdev/processors.py", line 231, in __call__
    def __call__(self, nb): return self.nb_proc(nb).process()
  File "/home/samsepiol/repos/fastai-libs/nbdev/nbdev/process.py", line 126, in process
    for proc in self.procs: self._proc(proc)
  File "/home/samsepiol/repos/fastai-libs/nbdev/nbdev/process.py", line 120, in _proc
    if hasattr(proc,'end'): proc.end()
  File "/home/samsepiol/repos/fastai-libs/nbdev/nbdev/frontmatter.py", line 66, in end
    self.fm.update({'output-file': _nbpath2html(Path(self.nb.path_)).name})
  File "/home/samsepiol/repos/fastai-libs/fastcore/fastcore/basics.py", line 247, in __getattr__
    def __getattr__(self,k): return self[k] if k in self else stop(AttributeError(k))
  File "/home/samsepiol/repos/fastai-libs/fastcore/fastcore/basics.py", line 216, in stop
    raise e
AttributeError: path_

Here is my folder structure in case that helps:

The error seems to be stemming from fastcore/basics.py

I also tried running the same command in a fresh environment that contains the conda versions of fastai, fastcore and nbdev

nbdev - 2.3.7
fastcore - 1.5.27
fastai - 2.7.9

And got the same error.

1 Like

These are my versions

nbdev 2.3.8
fastcore 1.5.28
fastai 2.7.10

Can you install the latest versions from GitHub instead and let us know if the same errors occur?

I have installed the latest versions from github matching:

And I am still getting the same error. nbdev_docs is also failing with the exact same error as the one I had posted on the initial image.

Can you share a minimally reproducible example? I am not able to replicate your issue.

So I figured out the bug. I had a _quarto.yml in my nbs folder that was created a long time ago but was still present. When deleting the one in the root folder, I missed this one.

I deleted it as Jeremy said in this post: Nbdev_preview fails. property name execute is invalid - #2 by jeremy

Thanks for your time Hamel.

2 Likes