KoljaB / RealtimeTTS

Converts text to speech in realtime
1.39k stars 119 forks source link

No module named 'RealtimeTTS' #55

Open rubenssoto opened 3 months ago

rubenssoto commented 3 months ago

I create a python virtual env and install the lib but I am having this error, any idea how to solve this?

from RealtimeTTS import TextToAudioStream, SystemEngine, AzureEngine, ElevenlabsEngine ModuleNotFoundError: No module named 'RealtimeTTS'

I am using ubuntu lts 22.04

thank you so much

KoljaB commented 3 months ago

Which python version are you using? I feel it might have something to do with one of the dependent libraries (coqui TTS library) failing to install for python >=3.12

rubenssoto commented 3 months ago

At the end of pip3 install RealtimeTTS I'm having this error: Python 3.10.12

` In file included from src/pyaudio/device_api.c:1: src/pyaudio/device_api.h:7:10: fatal error: Python.h: No such file or directory 7 | #include "Python.h" | ^~~~~~ compilation terminated. error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for PyAudio Failed to build PyAudio ERROR: Could not build wheels for PyAudio, which is required to install pyproject.toml-based projects`

KoljaB commented 3 months ago

Seems like pip install for pyaudio fails, one of the dependent libraries. Could you pls try the following:

sudo apt-get update
sudo apt-get install gcc
sudo apt-get install libportaudio2 
sudo apt-get install python3-pyaudio

Maybe it also needs

sudo apt-get install libasound-dev

Maybe also worth trying:

curl -O http://http.us.debian.org/debian/pool/main/p/python-pyaudio/python3-pyaudio_0.2.13-1+b2_amd64.deb
sudo dpkg -i python3-pyaudio_0.2.13-1+b2_amd64.deb

Hope that helps and sorry I'm a linux beginner.

rubenssoto commented 3 months ago

Thank you so much, I run all commands but I need to run one more: sudo apt install python3-dev build-essential

I had one more error: OSError: libespeak.so.1: cannot open shared object file: No such file or directory

So I did sudo apt install espeak

Now I having: ALSA lib pcm_dsnoop.c:601:(snd_pcm_dsnoop_open) unable to open slave ALSA lib pcm_dmix.c:1032:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card' ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card' ALSA lib pcm_dmix.c:1032:(snd_pcm_dmix_open) unable to open slave