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

jupyter-book cli does not work as stated in the getting started guide #208

Closed
cpjobling opened this issue Jun 5, 2019 · 9 comments
Closed

Comments

@cpjobling
Copy link

cpjobling commented Jun 5, 2019

I'm working on a Mac with anaconda version 4.6.14 and python 3.6.7.

I created a new conda environment and activated it, then, followed the instructions given in the "getting started guide", I installed the jupyter_hub CLI using pip:

pip install jupyter-book

After running

jupyter-book create mybook --demo

I then tried both

jupyter-book toc mybook\

and

jupyter-book build mybook\

and both failed (for different reasons).

jupyter-book toc failed because the script scripts/generate_toc.py was missing.

jupyter-book build failed with ModuleNotFoundError: No module named 'jupyter_contrib_nbextensions'.

I'm going to try installing jupyter-book from the repo, but wonder if this is a known error that should be fixed in the published version of jupyter-book.

@choldgraf
Copy link
Member

thanks for the info, and sorry you ran into some errors!

hmmmm, that's pretty strange, I haven't seen the generate_toc.py missing error. Could you give a bit more info about the version of python you're on etc?

@cpjobling
Copy link
Author

cpjobling commented Jun 5, 2019

I just did repeated the process from the repo (0.5.1dev0), used python setup.py install in a new conda environment and get the same errors.

My Setup:

MacOS: Mojave 10.14.5
Conda version: 4.6.14
Anaconda installed Python version: 3.6.7

Here are the relevant error traces:

In a new folder, I used

jupyter-book create using-jupyter --demo

then tried toc

jupyter-book toc using-jupyter
python: can't open file '/Users/anon/anaconda3/lib/python3.6/site-packages/jupyter_book-0.5.1.dev0-py3.6.egg/jupyter_book/scripts/generate_toc.py': [Errno 2] No such file or directory

and build

jupyter-book build using-jupyter
Convert and copy notebook/md files...
  0%|                                                    | 0/37 [00:00<?, ?it/s]Traceback (most recent call last):
  File "/Users/anon/anaconda3/envs/ltec-lnl2/bin/jupyter-nbconvert", line 11, in <module>
    load_entry_point('nbconvert==5.5.0', 'console_scripts', 'jupyter-nbconvert')()
  File "/Users/anon/anaconda3/envs/ltec-lnl2/lib/python3.6/site-packages/jupyter_core-4.4.0-py3.6.egg/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/Users/anon/anaconda3/envs/ltec-lnl2/lib/python3.6/site-packages/traitlets-4.3.2-py3.6.egg/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/Users/anon/anaconda3/envs/ltec-lnl2/lib/python3.6/site-packages/nbconvert-5.5.0-py3.6.egg/nbconvert/nbconvertapp.py", line 338, in start
    self.convert_notebooks()
  File "/Users/anon/anaconda3/envs/ltec-lnl2/lib/python3.6/site-packages/nbconvert-5.5.0-py3.6.egg/nbconvert/nbconvertapp.py", line 498, in convert_notebooks
    self.exporter = cls(config=self.config)
  File "/Users/anon/anaconda3/envs/ltec-lnl2/lib/python3.6/site-packages/nbconvert-5.5.0-py3.6.egg/nbconvert/exporters/templateexporter.py", line 255, in __init__
    super(TemplateExporter, self).__init__(config=config, **kw)
  File "/Users/anon/anaconda3/envs/ltec-lnl2/lib/python3.6/site-packages/nbconvert-5.5.0-py3.6.egg/nbconvert/exporters/exporter.py", line 110, in __init__
    self._init_preprocessors()
  File "/Users/anon/anaconda3/envs/ltec-lnl2/lib/python3.6/site-packages/nbconvert-5.5.0-py3.6.egg/nbconvert/exporters/exporter.py", line 264, in _init_preprocessors
    self.register_preprocessor(preprocessor, enabled=True)
  File "/Users/anon/anaconda3/envs/ltec-lnl2/lib/python3.6/site-packages/nbconvert-5.5.0-py3.6.egg/nbconvert/exporters/exporter.py", line 225, in register_preprocessor
    preprocessor_cls = import_item(preprocessor)
  File "/Users/anon/anaconda3/envs/ltec-lnl2/lib/python3.6/site-packages/traitlets-4.3.2-py3.6.egg/traitlets/utils/importstring.py", line 34, in import_item
    module = __import__(package, fromlist=[obj])
ModuleNotFoundError: No module named 'jupyter_contrib_nbextensions'

with the same result.

@choldgraf
Copy link
Member

and just to confirm, the jupyter-book create mybook command worked? And did you get those two errors when you created the book without using --demo? Or does it break in all cases?

@cpjobling
Copy link
Author

Yes, the command ``jupyter-book create mybook --demo` worked.

I haven't tried not using --demo. Will do so now.

@cpjobling
Copy link
Author

Got the same errors!

I'm assuming jupyter_book/scripts/generate_toc.py is not getting copied into the installed application and I need to install the jupyter_contrib_nbextensions module. The latter requirement may be due to my anaconda installation. I'd have to do a clean installation of anaconda to find out I suppose.

@cpjobling
Copy link
Author

I copied jupyter_book/scripts/generate_toc.py into the right place and hupyter-book toc worked!

I did

conda install -c conda-forge jupyter_contrib_nbextensions

and a lot of the Jupyter infrastructure was installed! Afterwards

jupyter-book build using-jupyter

worked fine.

@choldgraf
Copy link
Member

wohoo! ok so maybe we juts need to be more inclusive / clearer in our install dependencies, and to double-check the generate_toc script! Thanks for catching this!

@cpjobling
Copy link
Author

You're welcome.

@choldgraf
Copy link
Member

OK, I've opened #210 and #211 to track these bugs, so I'm gonna close this one and move activity to those more specific issues. If I missed something let me know!

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