Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when building nbsphinx docs - folder name is invalid #629

Closed
1kastner opened this issue Jan 10, 2022 · 9 comments
Closed

Error when building nbsphinx docs - folder name is invalid #629

1kastner opened this issue Jan 10, 2022 · 9 comments

Comments

@1kastner
Copy link
Contributor

1kastner commented Jan 10, 2022

I added a bit text to the documentation as we previously discussed at #624. I found the description in https://github.com/spatialaudio/nbsphinx/blob/master/CONTRIBUTING.rst about how to build the documentation.

(venv) PS XXX\nbsphinx> python setup.py build_sphinx
running build_sphinx
Running Sphinx v4.3.2
making output directory... done
checking bibtex cache... out of date
parsing bibtex file XXX\nbsphinx\doc\references.bib... parsed 2 entries
loading intersphinx inventory from https://ipython.readthedocs.io/en/stable/objects.inv...
loading intersphinx inventory from https://matplotlib.org/objects.inv...
loading intersphinx inventory from https://docs.scipy.org/doc/numpy/objects.inv...
loading intersphinx inventory from https://pandas.pydata.org/docs/objects.inv...
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
intersphinx inventory has moved: https://docs.scipy.org/doc/numpy/objects.inv -> https://numpy.org/doc/stable/objects.inv
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 67 source files that are out of date
updating environment: [new config] 67 added, 0 changed, 0 removed
XXX\nbsphinx\venv\lib\site-packages\jupytext\cell_reader.py:20: UserWarning: Sphinx Gallery in version 0.10.1 is not supported by Jupytext. Please use sphinx-gallery<=0.7.0 instead. If that is an issue, f
eel free to report it at https://github.com/mwouts/jupytext/issues, or even better, prepare a PR to handle the new signature of sphinx_gallery.notebook.rst2md.
  warnings.warn(
[IPKernelApp] ERROR | Exception while loading config file XXX\nbsphinx\doc\gallery\ipython_kernel_config.py
Traceback (most recent call last):
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\application.py", line 738, in _load_config_files
    config = loader.load_config()
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\loader.py", line 614, in load_config
    self._read_file_as_dict()
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\loader.py", line 646, in _read_file_as_dict
    exec(compile(f.read(), conf_filename, 'exec'), namespace, namespace)
  File "XXX\nbsphinx\doc\gallery\ipython_kernel_config.py", line 1
    ../ipython_kernel_config.py
    ^
SyntaxError: invalid syntax
[IPKernelApp] ERROR | Exception while loading config file XXX\nbsphinx\doc\gallery\ipython_kernel_config.py
Traceback (most recent call last):
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\application.py", line 738, in _load_config_files
    config = loader.load_config()
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\loader.py", line 614, in load_config
    self._read_file_as_dict()
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\loader.py", line 646, in _read_file_as_dict
    exec(compile(f.read(), conf_filename, 'exec'), namespace, namespace)
  File "XXX\nbsphinx\doc\gallery\ipython_kernel_config.py", line 1
    ../ipython_kernel_config.py
    ^
SyntaxError: invalid syntax
[IPKernelApp] ERROR | Exception while loading config file XXX\nbsphinx\doc\gallery\ipython_kernel_config.py
Traceback (most recent call last):
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\application.py", line 738, in _load_config_files
    config = loader.load_config()
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\loader.py", line 614, in load_config
    self._read_file_as_dict()
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\loader.py", line 646, in _read_file_as_dict
    exec(compile(f.read(), conf_filename, 'exec'), namespace, namespace)
  File "XXX\nbsphinx\doc\gallery\ipython_kernel_config.py", line 1
    ../ipython_kernel_config.py
    ^
SyntaxError: invalid syntax
[IPKernelApp] ERROR | Exception while loading config file XXX\nbsphinx\doc\gallery\ipython_kernel_config.py
Traceback (most recent call last):
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\application.py", line 738, in _load_config_files
    config = loader.load_config()
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\loader.py", line 614, in load_config
    self._read_file_as_dict()
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\loader.py", line 646, in _read_file_as_dict
    exec(compile(f.read(), conf_filename, 'exec'), namespace, namespace)
  File "XXX\nbsphinx\doc\gallery\ipython_kernel_config.py", line 1
    ../ipython_kernel_config.py
    ^
SyntaxError: invalid syntax
[IPKernelApp] ERROR | Exception while loading config file XXX\nbsphinx\doc\gallery\ipython_kernel_config.py
Traceback (most recent call last):
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\application.py", line 738, in _load_config_files
    config = loader.load_config()
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\loader.py", line 614, in load_config
    self._read_file_as_dict()
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\loader.py", line 646, in _read_file_as_dict
    exec(compile(f.read(), conf_filename, 'exec'), namespace, namespace)
  File "XXX\nbsphinx\doc\gallery\ipython_kernel_config.py", line 1
    ../ipython_kernel_config.py
    ^
SyntaxError: invalid syntax
Assertion failed: pfd.revents & POLLIN (C:\projects\libzmq\src\signaler.cpp:265)
reading sources... [100%] yet-another                                          
getting Git timestamps for source files... [100%] XXX\nbsphinx\doc\subdiry.doctrees\nbsphinx\subdiry.doctrees\nbsphinx
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\_build\.doctrees\nbsphinx\a-markdown-file.ipynb:13: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\_build\\.doctrees\\nbsphinx\\custom-formats.pct.py'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\_build\.doctrees\nbsphinx\a-markdown-file.ipynb:37: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\_build\\.doctrees\\nbsphinx\\markdown-cells.ipynb#Link
s-to-Other-Notebooks'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\_build\.doctrees\nbsphinx\a-markdown-file.ipynb:51: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\_build\\.doctrees\\nbsphinx\\markdown-cells.ipynb#Equa
tions'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\_build\.doctrees\nbsphinx\a-markdown-file.ipynb:: WARNING: image file not readable: _build/.doctrees/nbsphinx/_build/.doctrees/nbsphinx/images/notebook_icon.png 
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\_build\.doctrees\nbsphinx\allow-errors.ipynb:15: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\_build\\.doctrees\\nbsphinx\\pre-executed.ipynb'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\_build\.doctrees\nbsphinx\allow-errors.ipynb:17: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\_build\\.doctrees\\nbsphinx\\conf.py'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\a-markdown-file.ipynb:: WARNING: image file not readable: _build/.doctrees/nbsphinx/images/notebook_icon.png
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\allow-errors.ipynb:17: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\conf.py'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\code-cells.ipynb:780: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\ipython_kernel_config.py'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\configuring-kernels.ipynb:112: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\conf.py'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\custom-formats.ipynb:117: WARNING: Include file 'XXX\\nbsphinx\\doc\\_build\\.doctrees\\nbsphinx\\conf.py' not found or reading 
it failed
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\custom-formats.ipynb:114: WARNING: download file not readable: XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\conf.py
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\gallery\due-rst.ipynb:11: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\a-normal-rst-file.rst#thumbnail-galleries'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\gallery\due-rst.ipynb:13: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\conf.py'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\gallery\thumbnail-from-conf-py.ipynb:13: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\conf.py'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\gallery\thumbnail-from-conf-py.ipynb:77: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\gallery\\a-local-file.png'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\gallery\thumbnail-from-conf-py.ipynb:79: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\conf.py'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\gallery\uno-rst.ipynb:11: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\a-normal-rst-file.rst#thumbnail-galleries'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\gallery\uno-rst.ipynb:13: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\conf.py'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\installation.ipynb:11: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\contributing.rst'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\markdown-cells.ipynb:228: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\a-normal-rst-file.rst#references'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\markdown-cells.ipynb:235: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\a-normal-rst-file.rst#footnote-citations'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\markdown-cells.ipynb:649: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\a-normal-rst-file.rst'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\markdown-cells.ipynb:657: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\a-normal-rst-file.rst#sphinx-directives-for-info-warning-boxes'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\markdown-cells.ipynb:689: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\requirements.txt'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\markdown-cells.ipynb:711: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\a-normal-rst-file.rst#example_python_function'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\markdown-cells.ipynb:340: WARNING: image file not readable: _build/.doctrees/nbsphinx/images/notebook_icon.png
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\markdown-cells.ipynb:340: WARNING: image file not readable: _build/.doctrees/nbsphinx/images/notebook_icon.png
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\markdown-cells.ipynb:367: WARNING: image file not readable: _build/.doctrees/nbsphinx/images/notebook_icon.png
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\markdown-cells.ipynb:367: WARNING: image file not readable: _build/.doctrees/nbsphinx/images/notebook_icon.png
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\markdown-cells.ipynb:: WARNING: image file not readable: _build/.doctrees/nbsphinx/images/python_logo.svg
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\never-execute.ipynb:13: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\conf.py'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\orphan.ipynb:19: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\a-normal-rst-file.rst#links-to-notebooks-and-other-sphinx-source-files'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\orphan.ipynb:51: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\index.rst'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\prolog-and-epilog.ipynb:121: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\conf.py'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\raw-cells.ipynb:24: WARNING: image file not readable: _build/.doctrees/nbsphinx/images/raw_cells.png
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\raw-cells.ipynb:24: WARNING: image file not readable: _build/.doctrees/nbsphinx/images/raw_cells.png
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\subdir\a-notebook-in-a-subdir.ipynb:62: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\images\\notebook_icon.png'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\subdir\a-notebook-in-a-subdir.ipynb:15: WARNING: image file not readable: _build/.doctrees/nbsphinx/images/notebook_icon.png
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\subdir\a-notebook-in-a-subdir.ipynb:15: WARNING: image file not readable: _build/.doctrees/nbsphinx/images/notebook_icon.png
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\subdir\gallery.ipynb:33: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\a-normal-rst-file.rst#thumbnail-galleries'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\subdir\toctree.ipynb:72: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\a-normal-rst-file.rst'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\timeout.ipynb:13: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\conf.py'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\usage.ipynb:39: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\conf.py'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\usage.ipynb:96: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\a-normal-rst-file.rst#references'
XXX\nbsphinx\doc\_build\.doctrees\nbsphinx\usage.ipynb:147: WARNING: File not found: '_build\\.doctrees\\nbsphinx\\a-normal-rst-file.rst#references'

Extension error (sphinx_last_updated_by_git):
Handler <function _env_updated at 0x00000174E81EF040> for event 'env-updated' threw an exception (exception: [WinError 267] Der Verzeichnisname ist ungültig)

The last error message translates to "folder name is invalid. When I ran this code for the first time, the folder build without the prefix underscore was created and the subdirectory doctrees was filled. Now it is frequently updated with every execution. The neighbouring directory html stayed empty. The folder _build (with prefix) that was built when I ran python -m sphinx -W --keep-going --color -d _doctrees/ doc/ _build/linkcheck/ -b linkcheck (I took it from https://github.com/spatialaudio/nbsphinx/blob/master/.github/workflows/linkcheck.yml) has ben untouched since the last execution.

Could you shortly explain how python setup.py build_sphinx works and where it takes its default configuration from? It feels like one of the dependencies used here changed over time and now there is an issue. This assumption requires further examination of course.

@mgeier
Copy link
Member

mgeier commented Jan 10, 2022

../ipython_kernel_config.py

This looks like your system doesn't support symbolic links.

This is supposed to be a symbolic link: https://github.com/spatialaudio/nbsphinx/blob/master/doc/gallery/ipython_kernel_config.py

I don't know how, but I guess there's some way to get symlinks on Windows?

Could you shortly explain how python setup.py build_sphinx works and where it takes its default configuration from?

This command is kinda old school and nowadays it isn't recommended anymore. It will even be removed at some point (see sphinx-doc/sphinx#9595). I should probably stop recommending it.

You can use python -m sphinx ... instead (as you already mentioned above).

@mgeier
Copy link
Member

mgeier commented Jan 10, 2022

Oh, and I just spotted another problem (maybe the main problem): in conf.py, the _build directory is not ignored (which is very common in other projects).

You seem to be building the stuff in doc/_build right?

It would be easier if you run Sphinx from the main directory with something like this:

python -m sphinx doc _build

This way, the _build directory is outside the source directory and most of your errors should go away.

@1kastner
Copy link
Contributor Author

Well, git symbolic links do not work nicely on Windows. My first google hit was https://stackoverflow.com/questions/5917249/git-symlinks-in-windows and it looks like there is a solution somehow but a bit tricky. I will try it out. And thanks for the update on the building command!

@mgeier
Copy link
Member

mgeier commented Jan 10, 2022

Most of the answers are very old, this one seems reasonably recent: https://stackoverflow.com/a/59761201/.

@1kastner
Copy link
Contributor Author

1kastner commented Jan 10, 2022

Well, it improved:

(venv) PS XXX\nbsphinx> python -m sphinx doc _build
Running Sphinx v4.3.2
making output directory... done
checking bibtex cache... out of date
parsing bibtex file XXX\nbsphinx\doc\references.bib... parsed 2 entries
loading intersphinx inventory from https://ipython.readthedocs.io/en/stable/objects.inv...
loading intersphinx inventory from https://matplotlib.org/objects.inv...
loading intersphinx inventory from https://docs.scipy.org/doc/numpy/objects.inv...
loading intersphinx inventory from https://pandas.pydata.org/docs/objects.inv...
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
intersphinx inventory has moved: https://docs.scipy.org/doc/numpy/objects.inv -> https://numpy.org/doc/stable/objects.inv
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 34 source files that are out of date
updating environment: [new config] 34 added, 0 changed, 0 removed
XXX\nbsphinx\venv\lib\site-packages\jupytext\cell_reader.py:20: UserWarning: Sphinx Gallery in version 0.10.1 is not supported by Jupytext. Please use sphinx-gallery<=0.7.0 instead. If that is an issue, f
eel free to report it at https://github.com/mwouts/jupytext/issues, or even better, prepare a PR to handle the new signature of sphinx_gallery.notebook.rst2md.
  warnings.warn(
Assertion failed: pfd.revents & POLLIN (C:\projects\libzmq\src\signaler.cpp:265)
[IPKernelApp] ERROR | Exception while loading config file XXX\nbsphinx\doc\gallery\ipython_kernel_config.py
Traceback (most recent call last):
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\application.py", line 738, in _load_config_files
    config = loader.load_config()
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\loader.py", line 614, in load_config
    self._read_file_as_dict()
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\loader.py", line 646, in _read_file_as_dict
    exec(compile(f.read(), conf_filename, 'exec'), namespace, namespace)
  File "XXX\nbsphinx\doc\gallery\ipython_kernel_config.py", line 1
    ../ipython_kernel_config.py
    ^
SyntaxError: invalid syntax
Assertion failed: pfd.revents & POLLIN (C:\projects\libzmq\src\signaler.cpp:265)
[IPKernelApp] ERROR | Exception while loading config file XXX\nbsphinx\doc\gallery\ipython_kernel_config.py
Traceback (most recent call last):
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\application.py", line 738, in _load_config_files
    config = loader.load_config()
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\loader.py", line 614, in load_config
    self._read_file_as_dict()
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\loader.py", line 646, in _read_file_as_dict
    exec(compile(f.read(), conf_filename, 'exec'), namespace, namespace)
  File "XXX\nbsphinx\doc\gallery\ipython_kernel_config.py", line 1
    ../ipython_kernel_config.py
    ^
SyntaxError: invalid syntax
[IPKernelApp] ERROR | Exception while loading config file XXX\nbsphinx\doc\gallery\ipython_kernel_config.py
Traceback (most recent call last):
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\application.py", line 738, in _load_config_files
    config = loader.load_config()
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\loader.py", line 614, in load_config
    self._read_file_as_dict()
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\loader.py", line 646, in _read_file_as_dict
    exec(compile(f.read(), conf_filename, 'exec'), namespace, namespace)
  File "XXX\nbsphinx\doc\gallery\ipython_kernel_config.py", line 1
    ../ipython_kernel_config.py
    ^
SyntaxError: invalid syntax
[IPKernelApp] ERROR | Exception while loading config file XXX\nbsphinx\doc\gallery\ipython_kernel_config.py
Traceback (most recent call last):
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\application.py", line 738, in _load_config_files
    config = loader.load_config()
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\loader.py", line 614, in load_config
    self._read_file_as_dict()
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\loader.py", line 646, in _read_file_as_dict
    exec(compile(f.read(), conf_filename, 'exec'), namespace, namespace)
  File "XXX\nbsphinx\doc\gallery\ipython_kernel_config.py", line 1
    ../ipython_kernel_config.py
    ^
SyntaxError: invalid syntax
[IPKernelApp] ERROR | Exception while loading config file XXX\nbsphinx\doc\gallery\ipython_kernel_config.py
Traceback (most recent call last):
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\application.py", line 738, in _load_config_files
    config = loader.load_config()
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\loader.py", line 614, in load_config
    self._read_file_as_dict()
  File "XXX\nbsphinx\venv\lib\site-packages\traitlets\config\loader.py", line 646, in _read_file_as_dict
    exec(compile(f.read(), conf_filename, 'exec'), namespace, namespace)
  File "XXX\nbsphinx\doc\gallery\ipython_kernel_config.py", line 1
    ../ipython_kernel_config.py
    ^
SyntaxError: invalid syntax
reading sources... [100%] yet-another                                          
getting Git timestamps for source files... [100%] XXX\nbsphinx\doc\subdiry
getting Git timestamps for dependencies... [100%] XXX\nbsphinx\_build\.doctrees\nbsphinx
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] yet-another                                           
WARNING: RSVG converter command 'rsvg-convert' cannot be run. Check the rsvg_converter_bin setting
generating indices... genindex done
copying linked files... [100%] images\notebook_icon.png                        
copying notebooks ... [100%] yet-another.ipynb                                 
writing additional pages... search done
copying images... [100%] ../_build/.doctrees/nbsphinx/subdir_a-notebook-in-a-subdir_2_0.png
copying downloadable files... [100%] conf.py                                   
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 1 warning.

The HTML pages are in _build.
(venv) PS XXX\nbsphinx> 

The first step was deleting the build directories. Then I did as specified in the answer you highlighted. Maybe the system requires a reboot or some other default Windows magic to finally make the links work.

@mgeier
Copy link
Member

mgeier commented Jan 10, 2022

One of the comments on the SO answer says: "Also you have to re-clone repository to make symlinks work with it"

Did you do that?

@1kastner
Copy link
Contributor Author

1kastner commented Jan 10, 2022

Nope, I will do that next. Another source said that switching back and forth branches would do the job and it obviously did not work. Thus, I will follow the suggestion of just cloning everything again. Besides the symlink, the command python -m sphinx doc _build works like a charm. The issues about the missing files have been resolved.

@1kastner
Copy link
Contributor Author

With the fresh clone, now the links resolve as well. There are a few warnings left but I hope that they are "normal".

(venv) PS XXX\nbsphinx-with-symlinks> python setup.py build_sphinx                 
running build_sphinx
Running Sphinx v4.3.2
making output directory... done
checking bibtex cache... out of date
parsing bibtex file XXX\nbsphinx-with-symlinks\doc\references.bib... parsed 2 entries
loading intersphinx inventory from https://ipython.readthedocs.io/en/stable/objects.inv...
loading intersphinx inventory from https://matplotlib.org/objects.inv...
loading intersphinx inventory from https://docs.scipy.org/doc/numpy/objects.inv...
loading intersphinx inventory from https://pandas.pydata.org/docs/objects.inv...
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
intersphinx inventory has moved: https://docs.scipy.org/doc/numpy/objects.inv -> https://numpy.org/doc/stable/objects.inv
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 34 source files that are out of date
updating environment: [new config] 34 added, 0 changed, 0 removed
XXX\nbsphinx-with-symlinks\venv\lib\site-packages\jupytext\cell_reader.py:20: UserWarning: Sphinx Gallery in version 0.10.1 is not supported by Jupytext. Please u
se sphinx-gallery<=0.7.0 instead. If that is an issue, feel free to report it at https://github.com/mwouts/jupytext/issues, or even better, prepare a PR to handle the new signature of sphinx_ga
llery.notebook.rst2md.
  warnings.warn(
reading sources... [100%] yet-another                                          
getting Git timestamps for source files... [100%] XXX\nbsphinx-with-symlinks\doc\subdiry
getting Git timestamps for dependencies... [100%] XXX\nbsphinx-with-symlinks\build\sphinx\doctrees\nbsphinx
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] yet-another                                           
WARNING: RSVG converter command 'rsvg-convert' cannot be run. Check the rsvg_converter_bin setting
generating indices... genindex done
copying linked files... [100%] requirements.txt
copying notebooks ... [100%] yet-another.ipynb                                 
writing additional pages... search done
copying images... [100%] ../build/sphinx/doctrees/nbsphinx/subdir_a-notebook-in-a-subdir_2_0.png
copying downloadable files... [100%] conf.py
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 1 warning.

The HTML pages are in build\sphinx\html.
(venv) PS XXX\nbsphinx-with-symlinks> 

@mgeier
Copy link
Member

mgeier commented Jan 18, 2022

There are a few warnings left but I hope that they are "normal".

Yes, the one about Sphinx Gallery and Jupytext can be ignored, since we only use the CSS styling from Sphinx Gallery.
I hope the warning will disappear on its own some day.

The other one can be ignored as well, but I'm still working on removing it, see #559.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants