Make `spacy-pkuseg` an optional extra — it is the only thing blocking Python 3.14 installs

Author: cancan101Created Aug 10, 2026Updated Sep 29, 2026

chatterbox-tts 0.1.7 cannot be installed on Python 3.14 from wheels. The only cause is the unconditional spacy-pkuseg dependency, and it looks unintended: everything else in the package is already 3.14-ready.

The package is already prepared for 3.14

pyproject.toml carries deliberate markers for exactly this transition:

toml
# torch 2.6.0 supports Python 3.10-3.13; Python 3.14 needs 2.9.0+
"torch==2.6.0; python_version < '3.14'",
"torch>=2.9.0; python_version >= '3.14'",
"numpy>=1.24.0,<2.0.0; python_version < '3.13'",
"numpy>=2.0.0; python_version >= '3.13'",

Those markers resolve correctly, and torch publishes cp314 wheels. The work is done — except for one line.

The blocker

toml
"spacy-pkuseg",
Package Latest Released Wheel ABI tags
spacy-pkuseg 1.0.1 2025-07-14 cp39, cp310, cp311, cp312, cp313 — no cp314

Resolution on 3.14 fails outright:

× No solution found when resolving dependencies:
  Because all versions of spacy-pkuseg have no usable wheels and
  chatterbox-tts>=0.1.7 depends on spacy-pkuseg, we can conclude that
  chatterbox-tts>=0.1.7 cannot be used.

Environments without a compiler (slim/alpine containers, most CI images) cannot fall back to the sdist, so this is a hard install failure rather than a slow build. Upstream is aware of the gap but the fix is not moving: explosion/spacy-pkuseg#20 ("Run tests against Python 3.14 and add trove classifier", opened 2026-04-13) explicitly asks for 3.14 wheels — still open, no maintainer response, three . The project's last release was July 2025.

Why an extra is the natural fix

The code already treats it as optional. src/chatterbox/models/tokenizers/tokenizer.py:

python
def _init_segmenter(self):
    """Initialize pkuseg segmenter."""
    try:
        from spacy_pkuseg import pkuseg
        self.segmenter = pkuseg()
    except ImportError:
        logger.warning("pkuseg not available - Chinese segmentation will be skipped")
        self.segmenter = None

ImportError is caught, segmenter degrades to None, and a warning explains the consequence. Only the hard pin in pyproject.toml forces the install. Confirmed empirically on 3.13: with spacy-pkuseg uninstalled, from chatterbox.tts import ChatterboxTTS imports and works.

For English-only users — probably most of them — pkuseg is never exercised, yet it currently costs them a whole Python version.

Suggested change

toml
dependencies = [
    ...
    # "spacy-pkuseg",   <- removed from the hard set
]

[project.optional-dependencies]
zh = ["spacy-pkuseg"]

Users who need Chinese segmentation install chatterbox-tts[zh]; everyone else installs on 3.14 today. pykakasi (Japanese) is arguably the same case, though it does ship cp314 wheels so it blocks nothing right now.

If dropping it from the default set is too aggressive, a marker would also work and keeps current behavior everywhere it can:

toml
"spacy-pkuseg; python_version < '3.14'",

Happy to open a PR for whichever you prefer.