我试图在Ubuntu 18.04上构建HTML文档,但在运行make html
:时遇到了一个奇怪的错误
Exception occurred:
File "/home/cybo/.local/lib/python3.6/site-packages/nbsphinx.py", line 917, in parse
with open(dest, 'wb') as f:
OSError: [Errno 36] File name too long: '/home/cybo/Desktop/repositories/h2oai/docs/_build/doctrees/nbsphinx/_build_doctrees_nbsphinx__build_doctrees_nbsphinx__build_doctrees_nbsphinx__build_doctrees_nbsphinx__build_doctrees_nbsphinx__build_doctrees_nbsphinx__build_doctrees_nbsphinx__build_doctrees_nbsphinx__build_doctrees_nbsphinx__build_doctrees_nbsphinx__build_doctrees_nbsphinx__build_doctrees_nbsphinx__build_doctrees_nbsphinx__build_doctrees_nbsphinx__build_doctrees_nbsphinx__build_doctrees_nbsphinx_examples_autoviz_client_example_autoviz_client_example_11_1.png'
我可以通过删除这些文件夹来修复错误,但它们是重新创建的:
reading sources... [ 44%] _build/html/_build/html/_build/doctrees/nbsphinx/_build/doctrees/nbsphinx/_build/doctrees/nbsphinx/_build/html/_build/doctrees/nbsphinx/_build/doctrees/nbsphinx/examples/autoviz_client_example/autoviz_c
如果有任何帮助,我将不胜感激,这似乎是某种循环引用错误,我不知道如何修复。
我在使用nbsphinx
时也出现了同样的错误。问题是我忽略了在conf.py
中设置exclude_patterns
,并且每个后续构建都为_build
中的所有内容创建一个HTML文件。这意味着每一次构建都比前一次慢得多。真是一场噩梦!
我通过在conf.py
中放入以下内容来修复它:
extensions = [
'nbsphinx',
'sphinx.ext.mathjax',
]
exclude_patterns = ['_build', '**.ipynb_checkpoints']
我最初在nbsphinx说明书中找到了这些信息。希望它能有所帮助!