mozilla / TTS

:robot: :speech_balloon: Deep learning for Text to Speech (Discussion forum: https://discourse.mozilla.org/c/tts)
Mozilla Public License 2.0
9.43k stars 1.26k forks source link

No module named 'TTS' #51

Closed athuljayaraj closed 6 years ago

athuljayaraj commented 6 years ago

Python version: 3.6.6 requirements.txt installation successful. python3.6 setup.py develop successfully completed.

But TTS module not generated.

>>> from TTS.models.tacotron import Tacotron
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'TTS'

Are there any paths to be set? I am not using virtualenv.

Tried the same with miniconda as well, but no luck.

erogol commented 6 years ago

you need to do one of these;

export PYTHONPATH="/path/to/TTS"

or install TTS with ;

python setup.py develop

athuljayaraj commented 6 years ago

I tried both. No luck.

erogol commented 6 years ago

One must work. Are you sure you are okay with the environment? Maybe things got mixed between nomral python and conda environments?

athuljayaraj commented 6 years ago

Something's wrong with the path I guess. PYTHONPATH currently points to the git clone directory. Is that the right place?

$ echo $PYTHONPATH 
/path/to/TTS
>>> from TTS.utils.audio import AudioProcessor
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'TTS'
>>> from utils.audio import AudioProcessor
>>> AudioProcessor
<class 'utils.audio.AudioProcessor'>
erogol commented 6 years ago

This /path/to/TTS needs to be /path/to/parent_folder_of_TTS, if it is already not. Could you also try to install it as I showed above?

athuljayaraj commented 6 years ago

It's working! I changed /path/to/TTS to /path/to/parent_folder_of_TTS Thanks..

Should we update the wiki, for people like me who are new to this? Just a thought :)

erogol commented 6 years ago

good we solved that !

mrgloom commented 5 years ago

Also have this error on MacOS + Python 3.6.5, after python setup.py develop But this helped:

cd /Users/user/external_projects/text-to-speech
git clone git@github.com:mozilla/TTS.git
export PYTHONPATH="$PYTHONPATH:/Users/user/external_projects/text-to-speech"
mrgloom commented 5 years ago

But running notebooks/Benchmark.ipynb

Get error:

~/external_projects/text-to-speech/TTS/layers/attention.py in <module>
      2 from torch import nn
      3 from torch.nn import functional as F
----> 4 from utils.generic_utils import sequence_mask
      5 
      6 

ModuleNotFoundError: No module named 'utils.generic_utils'; 'utils' is not a package

After putting Benchmark.ipynb in git root folder it works. cp notebooks/Benchmark.ipynb Benchmark.ipynb

waydumbs commented 5 years ago

I'm still not clear about this at all. Mine is like: $ echo $PYTHONPATH /home/dude/Git/TTS

When you mean parent_folder_of_tts, do you mean: /home/dude/Git/ I've tried both and nether work. I still get: sudo nvidia-docker run -it --rm -p 5002:5002 mozilla-tts from synthesizer import Synthesizer File "/srv/app/server/synthesizer.py", line 8, in from utils.audio import AudioProcessor ModuleNotFoundError: No module named 'utils'

I've also tried: python setup.py develop error: Setup script exited with error: command 'g++' failed with exit status 1

When I got gcc 9.1.0-2 well as gcc 8 I dont get it...

xoxoxo13102020 commented 3 years ago

I am trying to run my code on collab but it gives me this error.

Traceback (most recent call last):
  File "TTS/train.py", line 27, in <module>
    from TTS.utils.speakers import load_speaker_mapping, save_speaker_mapping, \
  File "/usr/local/lib/python3.6/dist-packages/TTS-0.0.3+b1935c9-py3.6.egg/TTS/utils/speakers.py", line 4, in <module>
    from TTS.datasets.preprocess import get_preprocessor_by_name
  File "/usr/local/lib/python3.6/dist-packages/TTS-0.0.3+b1935c9-py3.6.egg/TTS/datasets/preprocess.py", line 9, in <module>
    from TTS.tts.utils.generic_utils import split_dataset
ModuleNotFoundError: No module named 'TTS.tts'

how to fix it?

thorstenMueller commented 3 years ago

What did you try already?

xoxoxo13102020 commented 3 years ago

I tried everything that you said @thorstenMueller

for this pip list | grep TTS @thorstenMueller TTS (0.0.3+b1935c9, /usr/local/lib/python3.6/dist-packages/TTS-0.0.3+b1935c9-py3.6.egg)

SqnLdr commented 3 years ago

@xoxoxo13102020 I encountered the same issue and solved it by checking out fork db7f3d3, i.e. git checkout db7f3d3

tiomaldy commented 3 years ago

Someone solve this in windows ?

tiomaldy commented 3 years ago

you need to do one of these;

export PYTHONPATH="/path/to/TTS"

or install TTS with ;

python setup.py develop

Where you put this ?

Alex-web0 commented 1 year ago

In case anyone comes across this issue on windows, here are the steps I took to solve it:

  1. I uninstalled python and then followed these instructions https://www.youtube.com/watch?v=zRaDe08cUIk&t=8s
  2. I then bumped into this issue, I restarted everything, also deactivated then activated the venv.
  3. Lastly, I upgraded TTS which in the video is 0.8.0 while the last version now is 0.10.0

Hope this helps someone!

yogesh1012-lgtm commented 10 months ago

you need to do one of these;

export PYTHONPATH="/path/to/TTS"

or install TTS with ;

python setup.py develop

how to export pythonpath im not coder please help

ABDULHAMEED-10 commented 8 months ago

solution is simple

  1. manually add env variable with variable Name = PYTHONPATH and Path "/path/of/parent-folder-TTS" In my case path of TTS was C:\Users\Abdul Hameed\AppData\Local\Programs\Python\Python310\Lib\site-packages
  2. Double check your python files make sure your local working files should not name as TTS