详细信息
我在阅读文档时遇到构建失败,我不明白。 nbsphinx.py 第 2151 行中的“逐字记录”断言导致构建失败。因此,当我尝试包含我创建的 Jupyter Notebook 教程时,构建失败。我将教程的当前版本与未导致构建失败的先前版本进行了比较,但我找不到可以解释当前失败的差异。
- 阅读文档项目网址:lofti_gaia
- 构建 URL:https://github.com/logan-pearce/lofti_gaia
- 读取文档用户名:logan-pearce
预期结果
包含 *.ipynb 文件的通过构建
实际结果
由于“Verbatim”断言失败,nbsphinx.py 第 2151 行构建失败。
终端输出:
Running Sphinx v4.1.2
loading translations [en]... done
making output directory... done
WARNING: html_static_path entry '_static' does not exist
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [latex]: all documents
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
processing lofti_gaia.tex... index installation tutorials/QuickStart tutorials/Tutorial api lofti loftitools
resolving references...
done
writing... failed
Exception occurred:
File "/home/docs/checkouts/readthedocs.org/user_builds/lofti-gaia/conda/latest/lib/python3.7/site-packages/nbsphinx.py", line 2151, in depart_codearea_latex
assert 'Verbatim' in lines[0]
AssertionError
The full traceback has been saved in /tmp/sphinx-err-x1h83s3m.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
最佳答案
根据 nbsphinx 的 github 问题 584 (https://github.com/spatialaudio/nbsphinx/issues/584),这是由于 sphinx 4.1.0 的兼容性问题。可以通过要求 sphinx 版本 4.0.2 来绕过它。
因此,在我的 requirements.txt
文件中,我包含了 sphinx==4.0.2
,之后构建就通过了。现在我的 requirements.txt
文件如下所示:
numpy
matplotlib
astropy>=4.0.1.post1
astroquery>=0.4
sphinx==4.0.2
ipython==7.19.0
nbsphinx>=0.8.6
以及构建过程。
关于jupyter-notebook - nbsphinx 在构建 Jupyter Notebook 时导致构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68642540/