4

I'm attempting to build HTML documentation on Ubuntu 18.04 but I'm running into a strange error when I run 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'

I'm able to fix the error by deleting these folders, but they are created again:

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

Would appreciate any help, seems to be some sort of circular referencing error that I'm not sure how to fix.

bad_coder
  • 11,289
  • 20
  • 44
  • 72
lightflow
  • 41
  • 1
  • Since you are using Ubuntu, [this thread might explain](https://stackoverflow.com/questions/34503540/why-does-python-give-oserror-errno-36-file-name-too-long-for-filename-short). The second answer [in this thread](https://stackoverflow.com/questions/29747108/subprocess-in-python-file-name-too-long) might solve your problem if you include it in your `docs/conf.py` file. [Have your tried these threads?](https://stackoverflow.com/search?tab=votes&q=OSError%3a%20Errno%2036%20File%20name%20too%20long%3a). You haven't explained you project structure, or the steps you took before `make html`. – bad_coder Apr 01 '20 at 17:10

1 Answers1

2

I had the same error using nbsphinx. The problem was that I had neglected to set exclude_patterns in my conf.py and each successive build was creating an HTML file for everything in _build. This meant that each build was exponentially slower than the previous one. What a nightmare!

I fixed it by putting the following in my conf.py:

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

I found this information originally in the nbsphinx instructions. Hope it helps!

jxmorris12
  • 1,262
  • 4
  • 15
  • 27