sphinx-doc / sphinx-autobuild

Watch a Sphinx directory and rebuild the documentation when a change is detected. Also includes a hot-reload web server.
MIT License
523 stars 75 forks source link

Theme error: no theme named 'pydata_sphinx_theme' #149

Closed shapiromatron closed 2 months ago

shapiromatron commented 3 months ago

I get an error in configuration when running sphinx-autobuild, but it works just fine when using the standard sphinx-build.

I'm using the pydata-sphinx-theme.

► sphinx-build -b html source build/html
... build succeeded.

► sphinx-autobuild -b html source build/html
sphinx_args.filenames=[]
[sphinx-autobuild] > sphinx-build -b html source build/html
Running Sphinx v7.2.6
loading pickled environment... done

Theme error:
no theme named 'pydata_sphinx_theme' found (missing theme.conf?)
Sphinx exited with exit code: 2
The server will continue serving the build folder, but the contents being served are no longer in sync with the documentation sources. Please fix the cause of the error above or press Ctrl+C to stop the server.
[I 240307 16:58:07 server:335] Serving on http://127.0.0.1:8000
[I 240307 16:58:07 handlers:62] Start watching changes
[I 240307 16:58:07 handlers:64] Start detecting changes
^C[I 240307 17:00:09 server:358] Shutting down..

The rendered output looks fine with the standard build command, I'm not sure what the issue is. Any ideas?

shapiromatron commented 3 months ago

I was able to fix it by adding import pydata_sphinx_theme to my conf.py file, but it seems odd (or at least different than sphinx core) that it's required for autobuild to resolve the theme information.

pradyunsg commented 3 months ago

Hmm, sphinx-autobuild literally just calls sphinx-build under the hood. Could you run things in verbose mode and, possibly, also print sys.path from conf.py to gather more diagnostics on this.

pradyunsg commented 3 months ago

Also, are both Sphinx and sphinx-autobuild installed in the same directory?