jupyter-book: max() arg is an empty sequence error in building book

When I try to build the demo book with:

jupyter-book create newbook/

And then build the book by:

jupyter-book build newbook

I receive the following output and error in the anaconda cmd window:

(wintest) C:\Users\laaltenburg>jupyter-book build newbook
Running Jupyter-Book v0.8.3
Traceback (most recent call last):
  File "c:\users\laaltenburg\.conda\envs\wintest\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\laaltenburg\.conda\envs\wintest\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\laaltenburg\.conda\envs\wintest\Scripts\jupyter-book.exe\__main__.py", line 7, in <module>
  File "c:\users\laaltenburg\.conda\envs\wintest\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\laaltenburg\.conda\envs\wintest\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "c:\users\laaltenburg\.conda\envs\wintest\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\laaltenburg\.conda\envs\wintest\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\laaltenburg\.conda\envs\wintest\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\users\laaltenburg\.conda\envs\wintest\lib\site-packages\jupyter_book\commands\__init__.py", line 199, in build
    build_modified = max([os.stat(ii).st_mtime for ii in build_files])
ValueError: max() arg is an empty sequence_

Something apparently is going wrong during the build, what could be the issue?

Thanks, Luuk

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (3 by maintainers)

Most upvoted comments

wohoo! I am glad that https://github.com/executablebooks/jupyter-book/pull/1153 seems to have worked haha

lol I’m happy to have helped you @luukalt … now I have to understand why it works on my ubuntu virtual box, but on windows 10 it doesn’t 🤣 … I think that is python 3.9.0 or 3.8 that doesn’t work on my machine… i will try with python 3.7.9!

EDIT: OK IT WORKED FLAWLESSY THIS TIME!! I was right! Python 3.9.0 and Python 3.8.5 don’t work on windows 10 with jupyter book (at least on my machine…)

Step that I did to make Jupyter Book working on my pc:

  1. Install Anaconda Individual Edition
  2. Launch Anaconda Navigator
  3. Go to Environments
  4. Create a new Environment and call it as you wish, select Python version 3.7
  5. Click the green button and select Open Terminal

Now from the terminal follow these steps:

  1. pip install -U jupyter-book
  2. pip uninstall sphinxcontrib-bibtex
  3. pip install sphinxcontrib-bibtex==1.0.0
  4. Now out of the terminal, go and find your "_ init .py" (low dash_low dash_init_low dash_low dash.py, all united) (mine was in "something\site-packages\jupyter_book\commands", you have to find where Anaconda installed it)
  5. Open the file with an editor and modify these lines: # build_modified = max([os.stat(ii).st_mtime for ii in build_files]) (comment this out with #) freshenv = True (set this to True)
  6. Save the file and go back to the terminal
  7. cd (Go to a folder of your choiche)
  8. jb create (Name of your choiche)
  9. jb build (same name as before)
  10. you should see something like this:
(jb_python_3_7_9) C:\Users\gaem1\Documents\JUPYTER BOOKS>jb build esempio3
Running Jupyter-Book v0.8.3
Source Folder: C:\Users\gaem1\Documents\JUPYTER BOOKS\esempio3
Config Path: C:\Users\gaem1\Documents\JUPYTER BOOKS\esempio3\_config.yml
Output Path: C:\Users\gaem1\Documents\JUPYTER BOOKS\esempio3\_build\html
Running Sphinx v3.3.1
myst v0.12.10: MdParserConfig(renderer='sphinx', commonmark_only=False, dmath_enable=True, dmath_allow_labels=True, dmath_allow_space=True, dmath_allow_digits=True, amsmath_enable=False, deflist_enable=False, update_mathjax=True, admonition_enable=False, figure_enable=False, disable_syntax=[], html_img_enable=False, url_schemes=['mailto', 'http', 'https'], heading_anchors=None)
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 4 source files that are out of date
updating environment: [new config] 4 added, 0 changed, 0 removed
reading sources... [ 25%] content                          reading sources... [ 50%] intro                            reading sources... [ 75%] markdown                         checking for C:\Users\gaem1\Documents\JUPYTER BOOKS\esempio3\references.bib in bibtex cache... not found
parsing bibtex file C:\Users\gaem1\Documents\JUPYTER BOOKS\esempio3\references.bib... parsed 5 entries
reading sources... [100%] notebooks                        Executing: notebooks in: C:\Users\gaem1\Documents\JUPYTER BOOKS\esempio3

WARNING: Execution Failed with traceback saved in C:\Users\gaem1\Documents\JUPYTER BOOKS\esempio3\_build\html\reports\notebooks.log
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [ 25%] content                           writing output... [ 50%] intro                             writing output... [ 75%] markdown                          writing output... [100%] notebooks                         
generating indices... genindex done
writing additional pages... search done
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 1 warning.

The HTML pages are in esempio3\_build\html.

===============================================================================

Finished generating HTML for book.
Your book's HTML pages are here:
    esempio3\_build\html\
You can look at your book by opening this file in a browser:
    esempio3\_build\html\index.html
Or paste this line directly into your browser bar:
    file://C:\Users\gaem1\Documents\JUPYTER BOOKS\esempio3\_build\html\index.html          

===============================================================================


(jb_python_3_7_9) C:\Users\gaem1\Documents\JUPYTER BOOKS>

victory

I wanted to thank all of you who helped me understand and solve the problem !!! @choldgraf @fcharih and @lewtun !!!