Generating docs when source and notebooks are in different folders

I am not able to run nbdev_build_docs in windows if notebooks and lib both are in subfolders (.\notebooks and .\src)

# Change to, e.g. "nbs", to put your notebooks in nbs dir instead of repo root
nbs_path = notebooks
doc_path = docs

# Anything shown as '%(...)s' is substituted with that setting automatically
url = /
doc_host = %(url)s 
doc_baseurl = /%(lib_name)s 
git_url =
lib_path = ./src/%(lib_name)s
title = %(lib_name)s

error is always the same

(base) D:\dev\nbdev>nbdev_build_docs
converting: D:\dev\nbdev\notebooks\index.ipynb
'D:\\dev\\nbdev\\notebooks\\index.ipynb' does not start with 'D:\\dev\\nbdev\\src'
Traceback (most recent call last):
  File "c:\users\z003yeph\appdata\local\continuum\anaconda3\lib\", line 193, in _run_module_as_main
"__main__", mod_spec)
  File "c:\users\z003yeph\appdata\local\continuum\anaconda3\lib\", line 85, in _run_code
exec(code, run_globals)
  File "C:\Users\z003yeph\AppData\Local\Continuum\anaconda3\Scripts\nbdev_build_docs.exe\", line 7, in <module>
  File "c:\users\z003yeph\appdata\local\continuum\anaconda3\lib\site-packages\fastscript\", line 76, in _f
  File "c:\users\z003yeph\appdata\local\continuum\anaconda3\lib\site-packages\nbdev\", line 219, in nbdev_build_docs
notebook2html(fname=fname, force_all=force_all, n_workers=n_workers)
  File "c:\users\z003yeph\appdata\local\continuum\anaconda3\lib\site-packages\nbdev\", line 579, in notebook2html
raise Exception(msg + '\n'.join([ for p,f in zip(passed,files) if not p]))
Exception: Conversion failed on the following:

tried symbolic links and junctions as described here (, but still not working under windows. any ideas?

Can you share your repo?

the only way to run nbdev_build_docs is when setting back the lib_path to the project root:
lib_path = %(lib_name)s
and create a symbolic link into the src/my_lib folder

1 Like

I’m not sure if the nbdev project cares much about what the PyPA recommends, but maybe a user should be warned in the docs that the “officially” motivated (= by the PyPA) src-layout structure is not supported by nbdev?