Skip to content

no theme named 'python-docs-theme' found (missing theme.conf?) #45

Closed

Description

@zdens

after installing this theme in virtual environment I've got "Theme error".
I do see "missing theme.conf" in the folder "venv/lib/python3.7/site-packages/python_docs_theme" but "make html" produces an error.
How can this error be fixed?

Activity

  1. beijersb commented on Jun 11, 2020

    @beijersb

    Hmm, i also got this error, after looking around for a while, finally found it:
    conf.py for your sphinx project should contain something like:
    extensions = [ ....., 'python_docs_theme', ]
    and further on:
    html_theme = 'python_docs_theme'
    Pay special attention to the _ (underscore); don't use - (minus sign).

    Works like a charm.
    Grtx,
    Ben

  2. JulienPalard commented on Jun 15, 2020

    @JulienPalard
    Member

    Interestingly, cpython just has html_theme = 'python_docs_theme', and we're not having the issue.

  3. andy-maier commented on Jul 21, 2020

    @andy-maier

    I can confirm the issue as described above, for Python 3.8.2 on macOS with Sphinx 3.1.2, and also that it went away after adding 'python_docs_theme' to extensions.

    I think the installation instructions on the README page should be updated accordingly (unless someone volunteers to find out why exactly it works without adding 'python_docs_theme' to extensions for the Python 3 docs).

  4. andy-maier commented on Jul 21, 2020

    @andy-maier

    I have created PR #48 to address this issue. Afterwards, I saw there is already PR #32 that addresses this similarly, but needs to be rebased. Let me know how to proceed there.

  5. JulienPalard commented on Jul 23, 2020

    @JulienPalard
    Member

    I checked the following steps on Debian:

    • Created a venv with Python 3.8.4
    • pip installed Sphinx==3.1.2 python-docs-theme==2020.1
    • ran sphinx-quickstart
    • ran make html
    • ran firefox _build/html/index.html

    and it worked as expected, no need to edit extensions for me.

    Can someone having the issue try this to compare?

  6. Mariatta commented on Sep 14, 2020

    @Mariatta
    Member

    For the core sprint repo, we only added the html_theme='python_docs_theme', using Python 3.8.3 and sphinx 3.2.1.

    I think it's not needed to add it to extensions.

  7. pradyunsg commented on May 1, 2021

    @pradyunsg
    Member

    I can confirm that the issue here is the - vs _.

    Setting the html_theme = "python_docs_theme" tries to import the package python_docs_theme as a plugin which obviously works. Similarly, html_theme = "python-docs-theme" tries to import the package python-docs-theme as a plugin which obviously does not work.

    This can be closed IMO.

  8. JulienPalard commented on May 1, 2021

    @JulienPalard
    Member

    Thanks @pradyunsg, and I agree, I'm closing this.

  9. deleted a comment from on Apr 24, 2022
  10. scott-griffiths commented on Sep 1, 2022

    @scott-griffiths

    I also had this issue with identical symptoms as the OP. The cause in my case was that Sphinx wasn't installed in the virtualenv that was activated. The Sphinx makefile would still run, but it was finding Sphinx outside of the virtualenv so the errors were very misleading.

    Fix was simply

    pip install sphinx

    and then adding it to my requirements.txt so that readthedocs would work as expected.

  11. peterjpxie commented on Jan 24, 2023

    @peterjpxie

    @scott-griffiths 's fix works for me. Thanks!

    My environment:

    Ubuntu 22.04, it comes with sphinx pre-installed at system path /usr/bin/sphinx-build.

    The same issue happens if I follow https://www.sphinx-doc.org/en/master/usage/installation.html#linux to install on Ubuntu16.04:

    apt-get install python3-sphinx
    
  12. goyalyashpal commented on Mar 28, 2024

    @goyalyashpal

    The Sphinx makefile would still run, but it was finding Sphinx outside of the virtualenv so the errors were very misleading.
    - @ scott-griffiths at #45 (comment)

    thanks a lot.

    for me, the issue was that i had not activated the .venv.
    i am using pdm build system, and so-far, i never needed to activate that due to it

    but yeah, for sphinx-build used by make html, source .venv/Scripts/activate fixed it :)
    looks like it's time to explore direnv or the like :D

    orrr, better yet, change the makefile lol 😄. no need to activate it again 😆

    - SPHINXBUILD   ?= sphinx-build
    + SPHINXBUILD   ?= pdm run sphinx-build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions