Skip to content

Stemming algorithm 'porter' not found with snowballstemmer 3.0.0 #13533

@JulianJvn

Description

@JulianJvn

Sphinx failures with snowballstemmer 3

UPDATE: snowballstemmer 3 has been yanked, pinning is now unneeded.

snowballstemmer==3.0.0 causes Sphinx builds to fail. We've asked upstream about this. For now, the best quick fix will be to pin to snowballstemmer<3, either directly or via a constraints file (pip, uv).

xref:


Describe the bug

snowballstemmer 3.0.0 has been released about an hour ago and it seems to break Sphinx. This is the contents of the sphinx-err-*.log file:

Versions
========

* Platform:         win32; (Windows-11-10.0.22631-SP0)
* Python version:   3.12.9 (CPython)
* Sphinx version:   8.2.3
* Docutils version: 0.21.2
* Jinja2 version:   3.1.6
* Pygments version: 2.19.1

Last Messages
=============



    looking for now-outdated files...
    none found
    pickling environment...
    done
    checking consistency...
    done
    preparing documents...
    failed

Loaded Extensions
=================

* sphinx.ext.mathjax (8.2.3)
* alabaster (1.0.0)
* sphinxcontrib.applehelp (2.0.0)
* sphinxcontrib.devhelp (2.0.0)
* sphinxcontrib.htmlhelp (2.1.0)
* sphinxcontrib.serializinghtml (2.0.0)
* sphinxcontrib.qthelp (2.0.0)

Traceback
=========

    Traceback (most recent call last):
      File "D:\home\tmp\sphinx-bug\.venv\Lib\site-packages\sphinx\cmd\build.py", line 432, in build_main
        app.build(args.force_all, args.filenames)
      File "D:\home\tmp\sphinx-bug\.venv\Lib\site-packages\sphinx\application.py", line 426, in build
        self.builder.build_update()
      File "D:\home\tmp\sphinx-bug\.venv\Lib\site-packages\sphinx\builders\__init__.py", line 375, in build_update
        self.build(
      File "D:\home\tmp\sphinx-bug\.venv\Lib\site-packages\sphinx\builders\__init__.py", line 454, in build
        self.write(docnames, updated_docnames, method)
      File "D:\home\tmp\sphinx-bug\.venv\Lib\site-packages\sphinx\builders\__init__.py", line 729, in write
        self.prepare_writing(docnames)
      File "D:\home\tmp\sphinx-bug\.venv\Lib\site-packages\sphinx\builders\html\__init__.py", line 438, in prepare_writing
        self.indexer = IndexBuilder(
                       ^^^^^^^^^^^^^
      File "D:\home\tmp\sphinx-bug\.venv\Lib\site-packages\sphinx\search\__init__.py", line 317, in __init__
        self.lang = lang_class(options)
                    ^^^^^^^^^^^^^^^^^^^
      File "D:\home\tmp\sphinx-bug\.venv\Lib\site-packages\sphinx\search\__init__.py", line 95, in __init__
        self.init(options)
      File "D:\home\tmp\sphinx-bug\.venv\Lib\site-packages\sphinx\search\en.py", line 215, in init
        self.stemmer = snowballstemmer.stemmer('porter')
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "D:\home\tmp\sphinx-bug\.venv\Lib\site-packages\snowballstemmer\__init__.py", line 27, in stemmer
        raise KeyError("Stemming algorithm '%s' not found" % lang)
    KeyError: "Stemming algorithm 'porter' not found"

Additional context

  • Output of pip list in the virtual environment:

    Package                       Version
    ----------------------------- ---------
    snowballstemmer               3.0.0
    Sphinx                        8.2.3
    
  • Running pip install snowballstemmer==2.2.0 fixes the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency filetype:bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions