13

I downloaded the read-the-docs theme for sphinx from Github and put it into the _themes folder.

conf.py:

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

However, running "make html" I get this error:

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?)

Somehow Sphinx seems to find the theme and then disregard it. Can someone tell me what is happening and how I can fix it?

mzjn
  • 48,958
  • 13
  • 128
  • 248
glades
  • 3,778
  • 1
  • 12
  • 34
  • 1
    I think you should _install_ the theme using "pip install sphinx-rtd-theme" (https://pypi.org/project/sphinx-rtd-theme/) – mzjn Sep 16 '21 at 11:05
  • That's right then it works. But I have another problem with templates in the _templates folder that don't trigger with the global theme installation via ´pip install sphinx-rtd-theme´ – glades Sep 16 '21 at 11:35
  • I don't know what you mean by "trigger with the global theme installation". – mzjn Sep 16 '21 at 11:38
  • @mzjn sorry, solved. I created the _templates folder at the wrong hierarchical level... To get back to the original question: Is the way via git repo not supported anymore then? – glades Sep 16 '21 at 11:39
  • Has it ever been supported to do it by downloading from GitHub? – mzjn Sep 16 '21 at 11:47
  • 1
    Yes apparently but it says it's deprecated (look at the bottom) https://sphinx-rtd-theme.readthedocs.io/en/stable/installing.html – glades Sep 16 '21 at 12:18

3 Answers3

18

Need to install:

pip install sphinx-rtd-theme
Ayub
  • 2,345
  • 27
  • 29
Frederico Gago
  • 180
  • 2
  • 6
  • this text coul be provided as a comment instead of a full answer – Victor Mar 30 '22 at 20:23
  • 2
    I do have `sphinx-rtd-theme` installed and still does not work. – Some Dev Jun 07 '22 at 21:59
  • @SomeDev Don't know if this helps, but I'm on an M1 and had the same issue. It's installed, pip throws "Requirement already satisfied" when trying to install it. I got around it by commenting out the 'html_theme = "sphinx_rtd_theme"' from the conf.py file. Not sure what the impact is, but the HTML generated ok for me after that. – Yasper Aug 11 '22 at 11:23
9

I solved it! (not the same as OP, since he did not have the package installed, but maybe it'll be useful for somebody)

If it doesn't work for you, be sure to use underscores in the conf.py file as the package uses normal dashes.

In conf.py it should be like this html_theme = 'sphinx_rtd_theme' not like this html_theme = 'sphinx-rtd-theme'

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

Some Dev
  • 185
  • 1
  • 9
0

I solved it using the underscore point mentioned by Some Dev, but I also needed to update pip to the latest version:

python.exe -m pip install --upgrade pip
Alexander L. Hayes
  • 3,892
  • 4
  • 13
  • 34
mnb
  • 1
  • 1