Installation
Matcha-TTS can be installed in multiple ways depending on your needs. Choose the method that works best for your workflow.Requirements
Matcha-TTS requires:- Python: 3.9 or higher (Python 3.10 recommended)
- PyTorch: 2.0 or higher
- CUDA: Optional, but recommended for GPU acceleration
For optimal performance, we recommend using a GPU with CUDA support. Matcha-TTS can run on CPU, but synthesis will be slower.
Quick Install with pip
The fastest way to get started is to install Matcha-TTS directly from PyPI:Installation Methods
- Conda + pip
- Install from Source
- Development Setup
Recommended: Using Conda Environment
Create an isolated environment to avoid dependency conflicts:Key Dependencies
Matcha-TTS relies on several important libraries:ONNX Support (Optional)
For ONNX export and inference:ONNX export requires PyTorch >= 2.1.0 because the
scaled_product_attention operator is not exportable in older versions.Verify Installation
After installation, verify that Matcha-TTS is working correctly:Check CLI Access
Test Basic Synthesis
- Download pre-trained models (on first run)
- Synthesize the text
- Save the output as
utterance_001.wavin the current directory
Available Commands
After installation, you’ll have access to these commands:Pre-trained Models
Pre-trained models are automatically downloaded to:- Linux/Mac:
~/.local/share/matcha_tts/ - Windows:
%LOCALAPPDATA%\matcha_tts\
matcha_ljspeech.ckpt: Single-speaker model (LJSpeech dataset)matcha_vctk.ckpt: Multi-speaker model (VCTK dataset, 108 speakers)hifigan_T2_v1: Vocoder for LJSpeechhifigan_univ_v1: Universal vocoder for VCTK
Models are downloaded automatically on first use. The initial run may take a few minutes to download models (~400MB total).
GPU Setup
For GPU acceleration, ensure CUDA is properly installed:False, you may need to reinstall PyTorch with CUDA support. Visit pytorch.org for platform-specific installation instructions.
Troubleshooting
Cython compilation errors
Cython compilation errors
If you encounter Cython compilation errors during installation:Make sure you have a C compiler installed (gcc on Linux, Xcode on Mac, Visual Studio on Windows).
Phonemizer installation issues
Phonemizer installation issues
The macOS:Windows:
Download and install from espeak-ng releases
phonemizer package requires espeak-ng to be installed on your system:Ubuntu/Debian:CUDA out of memory
CUDA out of memory
If you encounter CUDA out of memory errors:
- Reduce batch size (for training)
- Use the minimal memory configuration:
python matcha/train.py experiment=ljspeech_min_memory - Use CPU mode:
matcha-tts --text "..." --cpu
Import errors
Import errors
If you get import errors after installation:
- Make sure your conda environment is activated
- Try reinstalling:
pip install --force-reinstall matcha-tts - Check for conflicting package versions
Next Steps
Quick Start Guide
Learn how to use Matcha-TTS for speech synthesis with the CLI, Python API, and Gradio interface