fastai / nbdev

Create delightful software with Jupyter Notebooks
https://nbdev.fast.ai/
Apache License 2.0
4.93k stars 488 forks source link

_config.yml not included after clone from nbdev_template #34

Closed lewtun closed 4 years ago

lewtun commented 4 years ago

Description

I'm following the steps in the tutorial and find that the Build lib step fails with the following error:

$ nbdev_build_lib
Traceback (most recent call last):
  File "/usr/local/anaconda3/bin/nbdev_build_lib", line 8, in <module>
    sys.exit(nbdev_build_lib())
  File "/usr/local/anaconda3/lib/python3.7/site-packages/fastscript/core.py", line 73, in _f
    func(**args.__dict__)
  File "/usr/local/anaconda3/lib/python3.7/site-packages/nbdev/cli.py", line 20, in nbdev_build_lib
    notebook2script(fname=fname)
  File "/usr/local/anaconda3/lib/python3.7/site-packages/nbdev/export.py", line 364, in notebook2script
    update_baseurl()
  File "/usr/local/anaconda3/lib/python3.7/site-packages/nbdev/export.py", line 351, in update_baseurl
    with open(fname, 'r') as f: code = f.read()
FileNotFoundError: [Errno 2] No such file or directory: '/Users/lewtun/git/ds-lectures/docs/_config.yml'

For some reason, the _config.yml file is not generated when using nbdev_template - see here for an example of the contents of docs/ after creating the repo.

Steps to reproduce the problem

  1. Create a repo using nbdev_template
  2. Clone the repo
  3. Configure settings.ini
  4. Run nbdev_install_git_hooks (this works)
  5. Run nbdev_build_lib

Steps to fix the problem

Include _config.yml in the repo template. Adding this locally solved the problem for me.

sachinruk commented 4 years ago

+1 with the same issue. I created my nbdev repo yesterday as well.

daviddemeij commented 4 years ago

I also experienced the same issue.

daviddemeij commented 4 years ago

The new version of nbdev (cloned from Github) seems to fix this, probably it is not on pypi yet.

sgugger commented 4 years ago

Let me check when the last release was done, but I'll do one today if the fix is not on PyPi. It is on master, so closing this issue.

ctwardy commented 3 years ago

@sgugger - I hit basically the same issue today on a repo created by nbdev_new. Maybe that template didn't get updated?