狮身人面像阅读文档主题已识别但未"found"



我从Github下载了sphinx的read-the-docs主题,并将其放入_themes文件夹中。

conf.py:

html_theme = "sphinx_rtd_theme"
html_theme_path = ["_themes", ]

但是,运行"make html"我得到这个错误:

Sphinx v4.1.2 in Verwendung
Lade Übersetzungen [de]…erledigt
loading pickled environment... erledigt
WARNING: sphinx_rtd_theme (< 0.3.0) found. It will not be available since Sphinx-6.0
Theme error:
no theme named 'sphinx_rtd_theme' found (missing theme.conf?)

不知何故,斯芬克斯似乎找到了主题,然后忽视了它。有人能告诉我发生了什么,我该如何解决它吗?

需要安装:

pip install sphinx-rtd-theme

我解决了!(与OP不一样,因为他没有安装包,但也许它会对某些人有用)

如果它不适合您,则在conf.py文件中使用sure to use underscores,因为软件包使用正常的破折号。

conf.py中应该是这样的html_theme = 'sphinx_rtd_theme'不是这样的html_theme = 'sphinx-rtd-theme'

https://pypi.org/project/sphinx-rtd-theme/

我使用一些开发人员提到的下划线点解决了这个问题,但我还需要将pip更新到最新版本:

python.exe -m pip install --upgrade pip

最新更新