Install & Compatibility
Where this runs
tested against v1.13.3 · 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.95 runs
build_error
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.8s · import 0.000s · 47MB
45MB installed
● package 45MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
OfflineRecognizer
✓ import sherpa_onnx
✗ from sherpa_onnx import OfflineRecognizer
The recommended import is the module-level import; 'from sherpa_onnx import OfflineRecognizer' works but is less conventional.
OnlineRecognizer
✓ import sherpa_onnx
✗ from sherpa_onnx_core import OnlineRecognizer
sherpa-onnx-core does not expose a separate package; everything is under sherpa_onnx.
Basic offline ASR using pre-downloaded ONNX models.
import sherpa_onnx
recognizer = sherpa_onnx.OfflineRecognizer.from_models(
encoder="path/to/encoder.onnx",
decoder="path/to/decoder.onnx",
tokens="path/to/tokens.txt",
)
wave = sherpa_onnx.read_wave("test.wav")
result = recognizer.decode(wave)
print(result.text)
Errors
Common errors & fixes
ImportError: cannot import name 'OfflineRecognizer' from 'sherpa_onnx'
The 'sherpa-onnx-core' package does not include the Python bindings; only the C libraries.
fixInstall 'sherpa-onnx' (pip install sherpa-onnx) which provides the Python API.
ModuleNotFoundError: No module named 'sherpa_onnx'
Neither 'sherpa-onnx' nor 'sherpa-onnx-core' is installed.
fixRun 'pip install sherpa-onnx'.
RuntimeError: Model file not found: /path/to/encoder.onnx
The model path is incorrect or the model was not downloaded.
fixDownload the model files from the official model zoo and provide absolute paths.
Upgrade
Version history
1.13.3latest on PyPI · released Jun 15, 2026
Audit
Dependencies
No dependency data recorded yet.