Hi all,
I was trying to test Jupyter Books to convert my notebooks and my .md files into a nice readable piece, but I am failing on installing it, and so far I havent found why.
I am following the steps provided in https://jupyterbook.org/intro.html but I cant execute this command jupyter-book build ./mini_book. It always give me an error related with encoding problems, and to modules e.g. matplotlib. This last error I dont understand because I installed an environment that has all these packages before invoking the book build command.
This is very frustating because I am only following the steps they propose with a dummy test that does not work.
If you can give some hints of what is maybe happening it will be of great help!
So this is what appears after I run the command.
Basically a lot of warnings and an error with Sphinx .
I can also upload a Bug report issue to the Github repo, but if you have an idea , it will much better.
Thanks!
$ jupyter-book build ./mini_book
?[01mRunning Sphinx v2.4.4?[39;49;00m
?[01mbuilding [mo]: ?[39;49;00mtargets for 0 po files that are out of date
?[01mbuilding [html]: ?[39;49;00mtargets for 5 source files that are out of date
?[01mupdating environment: ?[39;49;00mExecuting: C:\Users\linigodelacruz\quantecon-mini-example\mini_book\docs\getting_started.md
Executing: C:\Users\linigodelacruz\quantecon-mini-example\mini_book\docs\learn_more.md
Executing: C:\Users\linigodelacruz\quantecon-mini-example\mini_book\docs\python_by_example.md
[new config] 5 added, 5 changed, 0 removed
?[01mchecking for C:\Users\linigodelacruz\quantecon-mini-example\mini_book\_bibliography\references.bib in bibtex cache... ?[39;49;00mnot found
?[01mparsing bibtex file C:\Users\linigodelacruz\quantecon-mini-example\mini_book\_bibliography\references.bib... ?[39;49;00mparsed 2 entries
?[01mreading sources... ?[39;49;00m[100%] ?[35mdocs/python_by_example?[39;49;00m
?[31mWARNING: Execution Failed: C:\Users\linigodelacruz\quantecon-mini-example\mini_book\docs\getting_started.md?[39;49;00m
?[31mWARNING: Execution Failed: C:\Users\linigodelacruz\quantecon-mini-example\mini_book\docs\learn_more.md?[39;49;00m
?[31mWARNING: Execution Failed: C:\Users\linigodelacruz\quantecon-mini-example\mini_book\docs\python_by_example.md?[39;49;00m
?[31mWARNING: Couldn't find cache key for notebook file mini_book\docs\getting_started.md. Outputs will not be inserted.
Last execution failed with traceback saved in C:\Users\linigodelacruz\quantecon-mini-example\mini_book\_build\html/reports/getting_started.log?[39;49;00m
?[31mWARNING: Couldn't find cache key for notebook file mini_book\docs\learn_more.md. Outputs will not be inserted.
Last execution failed with traceback saved in C:\Users\linigodelacruz\quantecon-mini-example\mini_book\_build\html/reports/learn_more.log?[39;49;00m
?[31mWARNING: Couldn't find cache key for notebook file mini_book\docs\python_by_example.md. Outputs will not be inserted.
Last execution failed with traceback saved in C:\Users\linigodelacruz\quantecon-mini-example\mini_book\_build\html/reports/python_by_example.log?[39;49;00m
?[31;01mSphinx error:?[39;49;00m
master file C:\Users\linigodelacruz\quantecon-mini-example\mini_book\docs\index.md not found
question 1: Yes , I checked , and it is where the problems with the modules start to appear:
In learn_more.log
nbconvert.preprocessors.execute.CellExecutionError: An error occurred while executing the following cell:
------------------
from sympy import Symbol
x, y = Symbol('x'), Symbol('y') # Treat 'x' and 'y' as algebraic symbols
x + x + x + y
------------------
ModuleNotFoundError: No module named 'sympy'
In Getting_started.log
nbconvert.preprocessors.execute.CellExecutionError: An error occurred while executing the following cell:
------------------
import numpy as np
import matplotlib.pyplot as plt
# Fixing random state for reproducibility
np.random.seed(19680801)
# Compute pie slices
N = 20
phi = np.linspace(0.0, 2 * np.pi, N, endpoint=False)
radii = 10 * np.random.rand(N)
width = np.pi / 4 * np.random.rand(N)
colors = plt.cm.viridis(radii / 10.)
ax = plt.subplot(111, projection='polar')
ax.bar(phi, radii, width=width, bottom=0.0, color=colors, alpha=0.5)
plt.show()
------------------
ModuleNotFoundError: No module named 'matplotlib'
In python_by_example.log
nbconvert.preprocessors.execute.CellExecutionError: An error occurred while executing the following cell:
------------------
import numpy as np
import matplotlib.pyplot as plt
ϵ_values = np.random.randn(100)
plt.plot(ϵ_values)
plt.show()
------------------
ModuleNotFoundError: No module named 'matplotlib'
Question 2:
linigodelacruz@TUD256635 MINGW64 ~
$ cd quantecon-mini-example/
linigodelacruz@TUD256635 MINGW64 ~/quantecon-mini-example (master)
$ ls
environment.yml mini_book/ README.md requirements.txt
linigodelacruz@TUD256635 MINGW64 ~/quantecon-mini-example (master)
$ cd mini_book/
linigodelacruz@TUD256635 MINGW64 ~/quantecon-mini-example/mini_book (master)
$ ls
_bibliography/ _build/ _config.yml _static/ _toc.yml docs/ qe-logo-large.png
linigodelacruz@TUD256635 MINGW64 ~/quantecon-mini-example/mini_book (master)
$ cd docs/
linigodelacruz@TUD256635 MINGW64 ~/quantecon-mini-example/mini_book/docs (master)
$ ls
about_py.md getting_started.md **index.md** learn_more.md python_by_example.md quant-econ.bib
It should be there because I cloned the original repository…
@Leila it seems your bug report set in motion a chain of events that landed on my desk. So it seems that my prior inaction was one of the reasons of the bug that you encountered
I am also experiencing problems with building the mini-book.
Similar to Leila, I also started with the demo book from Jupyter Book.
When I run the command (in anaconda prompt):
Running Jupyter-Book v0.8.3
Traceback (most recent call last):
File “c:\users\luuka\anaconda3\envs\wintest\lib\runpy.py”, line 193, in _run_module_as_main
“main”, mod_spec)
File “c:\users\luuka\anaconda3\envs\wintest\lib\runpy.py”, line 85, in run_code
exec(code, run_globals)
File "C:\Users\luuka\Anaconda3\envs\wintest\Scripts\jupyter-book.exe_main.py", line 7, in
File “c:\users\luuka\anaconda3\envs\wintest\lib\site-packages\click\core.py”, line 829, in call
return self.main(*args, **kwargs)
File “c:\users\luuka\anaconda3\envs\wintest\lib\site-packages\click\core.py”, line 782, in main
rv = self.invoke(ctx)
File “c:\users\luuka\anaconda3\envs\wintest\lib\site-packages\click\core.py”, line 1259, in invoke
return process_result(sub_ctx.command.invoke(sub_ctx))
File “c:\users\luuka\anaconda3\envs\wintest\lib\site-packages\click\core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “c:\users\luuka\anaconda3\envs\wintest\lib\site-packages\click\core.py”, line 610, in invoke
return callback(*args, **kwargs)
File "c:\users\luuka\anaconda3\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
Does anybody have an idea what I could do to fix this?
Let’s see if I can make sense of it. The line that is run checks when the file was last modified out of build_files, and then the function max complains that it’s called on an empty sequence (you can reproduce the same error by calling max([]) with an empty list as an argument.
Given that the variable name is build_files, it seems that you’re trying to build an empty jupyter book, could that be the case? Does the mini_book folder contain files to be built?
When I try to build this book it gives me the same error as before.
I believe this example contains build files, so maybe it is a windows issue (I also tried on another windows PC -> same error).