Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a problem in tutorial #428

Closed
yunlongYoung opened this issue Feb 20, 2021 · 6 comments
Closed

a problem in tutorial #428

yunlongYoung opened this issue Feb 20, 2021 · 6 comments

Comments

@yunlongYoung
Copy link

yunlongYoung commented Feb 20, 2021

When I run nbdev_build_lib followed the turorial,it runs to be a

>>FileNotFoundError: [Errno 2] No such file or directory: '/home/yunlong/nbdev_template/docs/_data/topnav.yml'

The nbdev lack a /_data directory under nbdev_template/doc, this need fix.

@hamelsmu
Copy link
Contributor

I don't get this error, are you using the latest version of nbdev as well as the latest template?

@yunlongYoung
Copy link
Author

yunlongYoung commented Feb 20, 2021

I did not set the lib_name, use, author, author_email, branch. Maybe that will cause that.

And when I run nbdev_build_doc, it cause an another problem.

(base) ➜  young git:(master) ✗ nbdev_build_docs
converting: /mnt/c/Users/drago/Documents/jupyter/young/index.ipynb
converting: /mnt/c/Users/drago/Documents/jupyter/young/00_core.ipynb
'HTMLExporter' object has no attribute 'template_path'
'HTMLExporter' object has no attribute 'template_path'
Traceback (most recent call last):
  File "/home/yunlong/anaconda3/bin/nbdev_build_docs", line 10, in <module>
    sys.exit(nbdev_build_docs())
  File "/home/yunlong/anaconda3/lib/python3.8/site-packages/fastscript/core.py", line 76, in _f
    func(**args.__dict__)
  File "/home/yunlong/anaconda3/lib/python3.8/site-packages/nbdev/cli.py", line 221, in nbdev_build_docs
    notebook2html(fname=fname, force_all=force_all, n_workers=n_workers, pause=pause)
  File "/home/yunlong/anaconda3/lib/python3.8/site-packages/nbdev/export2html.py", line 582, in notebook2html
    raise Exception(msg + '\n'.join([f.name for p,f in zip(passed,files) if not p]))
Exception: Conversion failed on the following:
00_core.ipynb
index.ipynb

How did I fix that?

WSL2, Ubuntu20.04, under Anaconda base ENV

@hamelsmu
Copy link
Contributor

I tested a fresh repo after following the tutorial with the latest nbdev release and everything works for me. https://github.com/hamelsmu/test-nbdev

I did the following steps:

  1. Create a new repo via the template
  2. Clone the repo locally, edited settings.ini and 00_Core.ipynb
  3. ran nbdev_build_lib
  4. ran nbdev_buidl_docs

Everything works as expected. I suggest you upgrade to the latest version on GitHub

pip install -U git+https://github.com/fastai/nbdev.git

Let us know if this doesn't fix your errors any issues. cc: @jph00

I did not set the lib_name, use, author, author_email, branch. Maybe that will cause that.

yes you need to edit your settings.ini per the tutorial. These are required values. You also need to run nbdev_build_lib before nbdev_build_docs.

Furthermore, you need to follow the tutorial carefully, the tutorial tells you to edit the notebooks 00_Core.ipynb and it appears you just left that notebook alone and didn't edit it as pointed out in the tutorial.

I would suggest slow down and follow all the steps in the tutorial. If you skip a step you will encounter problems

@yunlongYoung
Copy link
Author

yunlongYoung commented Feb 20, 2021

I found the reason. The Anaconda's default nbdev version is 0.2.40

' pip3 install -U nbdev' fixed that.

Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting nbdev

...

Installing collected packages: nbconvert, nbdev
  Attempting uninstall: nbconvert
    Found existing installation: nbconvert 6.0.7
    Uninstalling nbconvert-6.0.7:
      Successfully uninstalled nbconvert-6.0.7
  Attempting uninstall: nbdev
    Found existing installation: nbdev 0.2.40
    Uninstalling nbdev-0.2.40:
      Successfully uninstalled nbdev-0.2.40
ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

spyder 4.1.5 requires pyqt5<5.13; python_version >= "3", which is not installed.
spyder 4.1.5 requires pyqtwebengine<5.13; python_version >= "3", which is not installed.
spyder 4.1.5 requires jedi==0.17.1, but you'll have jedi 0.18.0 which is incompatible.
spyder 4.1.5 requires parso==0.7.0, but you'll have parso 0.8.1 which is incompatible.
Successfully installed nbconvert-6.0.7 nbdev-1.1.12
(base) ➜  young git:(master) ✗ nbdev_build_lib
Converted 00_core.ipynb.
Converted index.ipynb.
(base) ➜  young git:(master) ✗ nbdev_build_docs
converting: /mnt/c/Users/drago/Documents/jupyter/young/00_core.ipynb
converting: /mnt/c/Users/drago/Documents/jupyter/young/index.ipynb
converting /mnt/c/Users/drago/Documents/jupyter/young/index.ipynb to README.md
(base) ➜  young git:(master) ✗

Addtional mention, when I run 'pip3 install nbdev', it not worked on ubuntu20.04 under wsl2. So I install nbdev by install anaconda first, then use 'conda install -c fastai nbdev', it succeed. and then because of default nbdev version is 0.2.40 in conda, an error "'HTMLExporter' object has no attribute 'template_path'" occured. But 'pip3 install -U nbdev' fixed that. All this makes me a little dizzy.

Strongly suggest everyone should run 'pip install -U nbdev' or 'pip3 install -U nbdev' after install nbdev by anaconda, can you kindly metion this in the tutorial or install instruction? @hamelsmu

@hamelsmu
Copy link
Contributor

@yunlongYoung that is realy interesting. Do you mind opening an issue specifically about the problems you are experiencing with conda? Thanks so much!

@hamelsmu
Copy link
Contributor

hamelsmu commented Feb 20, 2021

I went ahead and opened the issue on your behalf #430 nevermind I see you opened #431. Thanks for doing that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants