Skip to content

Make spacy-pkuseg an optional [zh] extra - #547

Open
cancan101 wants to merge 1 commit into
resemble-ai:masterfrom
cancan101:optional-spacy-pkuseg
Open

cancan101 wants to merge 1 commit into
resemble-ai:masterfrom
cancan101:optional-spacy-pkuseg

Conversation

@cancan101

Copy link
Copy Markdown

spacy-pkuseg is the only thing preventing chatterbox-tts from installing on Python 3.14. Its latest release (1.0.1, July 2025) publishes wheels through cp313 only, and the sdist cannot be built in environments without a compiler, so pip install chatterbox-tts fails outright on 3.14 rather than falling back.

Everything else in the package is already 3.14-ready: the torch, torchaudio and numpy pins carry explicit python_version markers for exactly this transition, and all of them publish cp314 wheels.

The code already treats the dependency as optional. MTLTokenizer's _init_segmenter catches ImportError, sets self.segmenter = None and logs that Chinese segmentation will be skipped, so a missing spacy-pkuseg degrades gracefully today. Only the hard pin in pyproject.toml forces it to be present, which costs every English-only user a whole Python version.

Users who need Chinese segmentation install chatterbox-tts[zh]; behavior is unchanged for them. Users who don't now install on 3.14.

Verified: the built METADATA declares Provides-Extra: zh and Requires-Dist: spacy-pkuseg; extra == "zh" with no unconditional requirement, and pip install --dry-run --only-binary :all: . now resolves the full tree on Python 3.14 (torch 2.13.0, torchaudio 2.11.0, transformers 5.2.0, gradio 6.8.0) where it previously failed. Separately, on 3.13, uninstalling spacy-pkuseg leaves from chatterbox.tts import ChatterboxTTS working.

Resolves #546

spacy-pkuseg is the only thing preventing chatterbox-tts from installing on
Python 3.14. Its latest release (1.0.1, July 2025) publishes wheels through
cp313 only, and the sdist cannot be built in environments without a
compiler, so `pip install chatterbox-tts` fails outright on 3.14 rather
than falling back.

Everything else in the package is already 3.14-ready: the torch, torchaudio
and numpy pins carry explicit python_version markers for exactly this
transition, and all of them publish cp314 wheels.

The code already treats the dependency as optional. MTLTokenizer's
_init_segmenter catches ImportError, sets self.segmenter = None and logs
that Chinese segmentation will be skipped, so a missing spacy-pkuseg
degrades gracefully today. Only the hard pin in pyproject.toml forces it to
be present, which costs every English-only user a whole Python version.

Users who need Chinese segmentation install chatterbox-tts[zh]; behavior is
unchanged for them. Users who don't now install on 3.14.

Verified: the built METADATA declares `Provides-Extra: zh` and
`Requires-Dist: spacy-pkuseg; extra == "zh"` with no unconditional
requirement, and `pip install --dry-run --only-binary :all: .` now resolves
the full tree on Python 3.14 (torch 2.13.0, torchaudio 2.11.0,
transformers 5.2.0, gradio 6.8.0) where it previously failed. Separately, on
3.13, uninstalling spacy-pkuseg leaves `from chatterbox.tts import
ChatterboxTTS` working.

Refs resemble-ai#546
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants