Python sphinx 生成HTML文件时出现文件名过长错误
我试图在Ubuntu18.04上构建HTML文档,但在运行Python sphinx 生成HTML文件时出现文件名过长错误,python-sphinx,Python Sphinx,我试图在Ubuntu18.04上构建HTML文档,但在运行makeHTML时遇到了一个奇怪的错误: 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/r
makeHTML
时遇到了一个奇怪的错误:
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\u模式
,每个后续构建都为\u构建
中的所有内容创建了一个HTML文件。这意味着每一次构建都比前一次慢了很多。真是一场噩梦
我通过在我的conf.py
中添加以下内容来修复它:
extensions = [
'nbsphinx',
'sphinx.ext.mathjax',
]
exclude_patterns = ['_build', '**.ipynb_checkpoints']
我最初是在网上找到这个信息的。希望有帮助 由于您使用的是Ubuntu。如果将第二个答案包含在docs/conf.py
文件中,它可能会解决您的问题。您没有解释您的项目结构,也没有解释您在生成html
之前所采取的步骤。