Installation & Environment
Create the isolated Python environment, pin the packages, and install them so the GPU build of PyTorch is used.
Requirements
- Python 3.11, the version this setup is tested on. Check with
python --version - An NVIDIA GPU with a current driver, for the cloned voice. Check with
nvidia-smi. Everything else runs without one - About 10 GB of free disk space: PyTorch alone is about 2.5 GB and the XTTS model about 2 GB
- A stable connection. Large downloads resume on their own if they time out
The commands below are for Windows PowerShell. On macOS or Linux, activate with source .venv-tts/bin/activate and set variables with export. CUDA builds of PyTorch are for NVIDIA GPUs only.
Create the environment
Create it inside the project folder. Don't pass --system-site-packages: that lets the environment borrow packages from your global Python, and installs can then change packages other projects depend on.
cd N.O.V.A
python -m venv .venv-tts
Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
.\.venv-tts\Scripts\Activate.ps1The Set-ExecutionPolicy line only applies to the current terminal, and is needed if PowerShell refuses to run the activation script. The prompt should now start with (.venv-tts).
Check that the environment is isolated before installing anything:
python -m pip -V
python -m pip listpip -Vshould show a path inside.venv-ttspip listshould show onlypipandsetuptools
If the list shows dozens of packages, delete the folder and recreate it with the plain command above. From here on, always use python -m pip and check for the (.venv-tts) prefix in your prompt, so packages install into the environment you are actually running.
Keep downloads off your system drive
Pip and the model libraries use temporary and cache folders on the system drive by default, even when the environment lives elsewhere. Point them at the drive you want before installing. Replace D: with your own drive; these last for the current terminal only.
mkdir D:\Temp, D:\pip-cache -Force
$env:TEMP = "D:\Temp"
$env:TMP = "D:\Temp"
$env:PIP_CACHE_DIR = "D:\pip-cache" Model locations are set permanently with TTS_HOME and HF_HOME. See Settings.
The package list
These are the voice and audio lines of requirements.txt. They are pinned so pip can't quietly pick an incompatible build:
--extra-index-url https://download.pytorch.org/whl/cu121
torch==2.5.1+cu121
torchaudio==2.5.1+cu121
transformers==4.57.6
coqui-tts==0.27.5
sounddevice
soundfile
pyttsx3
SpeechRecognition
PyAudio==0.2.14
python-dotenv| Line | Why |
|---|---|
--extra-index-url ...cu121 | Lets pip find PyTorch's CUDA builds as well as normal PyPI packages |
torch==2.5.1+cu121, torchaudio==2.5.1+cu121 | The +cu121 suffix stops pip choosing the CPU-only build, which can't use the GPU. 2.5.1 is the newest build published for cu121 |
transformers==4.57.6 | transformers 5.x needs PyTorch 2.6 or newer. With torch 2.5.1 it disables PyTorch, and Coqui TTS then reports torch as missing |
coqui-tts==0.27.5 | The maintained fork that provides XTTS-v2. Not the old TTS package |
PyAudio==0.2.14 | Needed for microphone input |
Don't list numpy, librosa or similar. They arrive automatically with coqui-tts.
Install
python -m pip install --upgrade pip
python -m pip install -r requirements.txt --no-cache-dir- The torch download is about 2.5 GB, so the first install takes a while. If pip prints a timeout warning it resumes the download itself. If it stops completely, rerun the same command
--no-cache-diravoids a pipMemoryErrorcaused by loading a huge cached download into RAM- If it still runs out of memory, close heavy apps such as browser tabs or Ollama and retry
Verify the install
python -c "import torch, transformers; print(torch.__version__, torch.cuda.is_available(), transformers.__version__)"Expected output: 2.5.1+cu121 True 4.57.6. If torch shows +cpu or False, reinstall the GPU build without touching the other packages:
python -m pip install torch==2.5.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu121 --force-reinstall --no-deps --no-cache-dirAnother package can swap in a CPU build of torch. Run the check above after each later pip install.
Then confirm there are no dependency conflicts, and that packages really live inside the environment:
python -m pip check
python -c "import torch, TTS; print(torch.__file__); print(TTS.__file__)"Both printed paths should be inside the .venv-tts folder.
Lock the versions
Once everything works, record the exact version of every package:
python -m pip freeze > requirements.lock.txtKeep requirements.txt as the readable list. If you rebuild from the lock file, keep the --extra-index-url line at the top of it, because freeze doesn't write that line.
Next steps
- Custom Voice: record a sample and speak in your own voice
- Settings: every option in
config/.env - Troubleshooting: fixes for the errors you are most likely to hit