No module named TTS

Hello everyone, I was just playing around with mozilla tools and wants to use moz TTS for my project.

  1. I clone the TTS repository
  2. Run “python setup.py develop” successfully
  3. Also downloaded best_model.pth.tar and config.json file.
  4. Store these files in a folder named tts_model inside tts folder.
  5. In the same folder tts_model I’m using train.py file.
    But everytime I run train.py file, I got this error
    "" Traceback (most recent call last):
    ** File “text.py”, line 7, in **
    ** from TTS.models.tacotron import Tacotron**
    ModuleNotFoundError: No module named ‘TTS’""
    I tried something available on the discussion but still can’t come up with the solution. can someone please help me out in this.
    I’m using Windows 7
    Thank you so much.
    Using visual studio for IDE
    You can find the error below for better understanding.

error1

You have to install TTS system wide first. Run python3 setup.py develop

Thank you for the positive response.
Actually I run this command successfully, still getting the same error.
You can find the glimpse of the output after running “python setup.py develop”

running this command on the folder "TTS"

I hope you understand my concern

Have you follow the steps at https://colab.research.google.com/gist/erogol/97516ad65b44dbddb8cd694953187c5b/tts_example.ipynb ?

Thank you so much for your reply.
I’m afraid that I didn’t follow the steps in the link suggested by you.
In place of that, I was following the below link.

In this link, I was following step 3
Step 3 is used for mozilla TTS. If you find, this is something wrong which I’m doing then please guide me in the same.
Thanks in advance.

Well, the minimal example for me was this


from deepspeech import Model
import scipy
import scipy.io.wavfile

filename = "/home/tyoc213/Documentos/github/fairseq/hello.wav"
samplerate, data = scipy.io.wavfile.read(filename) #.read(bytes)

ds = Model('/home/tyoc213/Descargas/DATASET/deepspeech-0.7.4-models.pbmm') # , N_FEATURES) #, N_CONTEXT) #, 'model/alphabet.txt' , BEAM_WIDTH)

recognized_text = ds.stt(data)
    
print(f"El texto reconocido es <<{recognized_text}>>")    

It ouputs

deep_voice.py:8: WavFileWarning: Reached EOF prematurely; finished at 87274 bytes, expected 2147418156 bytes from header.
  samplerate, data = scipy.io.wavfile.read(filename) #.read(bytes)
TensorFlow: v1.15.0-24-gceb46aa
DeepSpeech: v0.7.4-0-gfcd9563
2020-07-03 23:53:06.827760: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
El texto reconocido es <<fholo>>

from 1 of the the pinned post https://blog.rasa.com/how-to-build-a-voice-assistant-with-open-source-rasa-and-mozilla-tools/

Sorry to say, but I’m trying TTS, and I’m afraid that this is the example for deepspeech STT. Are you having anything related to TTS?

Oh, yes, Indeed!!!, sorry for that :slight_smile:

If I get something working, I will get back and post it.

Yeah working with TTS.
Trying to follow step 3 from this blog.

Hey! Have you solved the problem now? I have the same problem as you. Please let me know if you have a solution. Thank you very much!

A quick fix to this is export PYTHONPATH=/path/to/folder/TTS/, e.g when you have TTS installed in “/home/myuser/TTS” your PYTHONPATH is “/home/myuser”.