构建HTML文件时文件名过长错误

问题描述 投票:1回答:1

我正在尝试在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

非常感谢您的帮助,似乎是某种循环引用错误,我不确定该如何解决。

python-sphinx documentation-generation
1个回答
0
投票

我在使用nbsphinx时遇到了相同的错误。问题是我忽略了在exclude_patterns中设置conf.py,并且每个后续构建都为_build中的所有内容创建了HTML文件。这意味着每个构建都比以前的构建慢得多。什么样的恶梦!

我通过在conf.py中放置以下内容来修复它:

extensions = [
    'nbsphinx',
    'sphinx.ext.mathjax',
]
exclude_patterns = ['_build', '**.ipynb_checkpoints']

我最初是在nbsphinx instructions中找到此信息的。希望对您有所帮助!

© www.soinside.com 2019 - 2024. All rights reserved.