Install & Compatibility
Where this runs
tested against v2.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 2.038s · 195.2MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 12.5s · import 1.930s · 189MB
196MB installed
● package 196MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
gruut
✓ import gruut
Top-level import; use gruut.sentences() for processing.
Phonemizer
✓ from gruut import phonemizer
✗ from gruut.phonemizer import Phonemizer
The phonemizer function is in the top-level gruut module.
Tokenize and phonemize a sentence with gruut.
import gruut
text = "Hello world."
# Use a language code (e.g., 'en-us')
for sentence in gruut.sentences(text, lang='en-us'):
for word in sentence:
if word.phonemes:
print(f"{word.text}: {' '.join(word.phonemes)}")
gruut --version
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'gruut.lang'
Missing language data package for the requested language.
fixInstall the corresponding gruut-lang-<lang> package, e.g., pip install gruut-lang-en.
AttributeError: module 'gruut' has no attribute 'text_to_phonemes'
Using old API from gruut v1.x.
fixUse gruut.sentences() instead. See quickstart.
ValueError: Unknown language: en
Language code not recognized because data not installed.
fixInstall the language data package for 'en' (e.g., gruut-lang-en).
Upgrade
Version history
2.4.0latest on PyPI · released Jul 3, 2024
Audit
Dependencies
gruut-lang-enoptionalEnglish language data is now a separate package (since v2.1.0).