-
-
Notifications
You must be signed in to change notification settings - Fork 901
Description
Documentation
After reading the devguide https://devguide.python.org/documentation/start-documenting/#building-the-documentation to build the documentation, I faced the very common error: no theme named 'python-docs-theme' found (missing theme.conf?).
(cpython) peter@xxx:~/repo/cpython/Doc$ sphinx-build -b html . build/html
Running Sphinx v4.3.2
Theme error:
no theme named 'python_docs_theme' found (missing theme.conf?)
(cpython) peter@xxx:~/repo/cpython/Doc$ which sphinx-build
/usr/bin/sphinx-build
The root cause is that sphinx is not installed in the virtual env where python-docs-theme is installed, as mentioned in python-docs-theme issue #45.
Full Steps to Reproduce:
Use ubuntu 22.04 or 16.04
apt-get install python3-sphinx # as per https://www.sphinx-doc.org/en/master/usage/installation.html#linux
<create a virtual env>
pip install blurb
pip install python-docs-theme
cd Doc
make html
or
sphinx-build -b html . build/html
Of course, it works if you follow exactly this:
cd Doc
make venv
make html
Where does the confusion come from:
"You are expected to have installed the latest stable version of Sphinx and blurb on your system or in a virtualenv (which can be created using make venv), so that the Makefile can find the sphinx-build command. You can also specify the location of sphinx-build with the SPHINXBUILD make variable. "
1/ Sphinx This links to https://www.sphinx-doc.org and it provides installation steps apt-get install python3-sphinx
which installs sphinx in system path /usr/bin/sphinx-build. It won't work with python-docs-theme installed in a virtualenv.
[Suggestion] Change the sphinx link to https://github.com/sphinx-doc/sphinx which provide install step pip install -U sphinx
instead.
2/ "You can also specify the location of sphinx-build with the SPHINXBUILD make variable" => this also makes me think sphinx-build is okay to be anywhere, but it is not.