gitmylo / audio-webui

A webui for different audio related Neural Networks
MIT License
1.01k stars 94 forks source link

[ISSUE] Unable to Install - ModuleNotFoundError: No module named 'MeCab' #91

Closed indubwestep closed 1 year ago

indubwestep commented 1 year ago

I tried installing mecab-python3 and unidic-lite using pip install but this did not change the outcome. How can I fix this error?

Traceback (most recent call last):
  File "M:\audio-webui\audio-webui\venv\lib\site-packages\TTS\tts\utils\text\japanese\phonemizer.py", line 8, in <module>
    import MeCab
ModuleNotFoundError: No module named 'MeCab'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "M:\audio-webui\audio-webui\main.py", line 23, in <module>
    from webui.modules.implementations.tts_monkeypatching import patch as patch1
  File "M:\audio-webui\audio-webui\webui\modules\implementations\__init__.py", line 1, in <module>
    import webui.modules.implementations.ttsmodels as tts
  File "M:\audio-webui\audio-webui\webui\modules\implementations\ttsmodels.py", line 11, in <module>
    from TTS.api import TTS
  File "M:\audio-webui\audio-webui\venv\lib\site-packages\TTS\api.py", line 15, in <module>
    from TTS.utils.synthesizer import Synthesizer
  File "M:\audio-webui\audio-webui\venv\lib\site-packages\TTS\utils\synthesizer.py", line 10, in <module>
    from TTS.tts.configs.vits_config import VitsConfig
  File "M:\audio-webui\audio-webui\venv\lib\site-packages\TTS\tts\configs\vits_config.py", line 5, in <module>
    from TTS.tts.models.vits import VitsArgs, VitsAudioConfig
  File "M:\audio-webui\audio-webui\venv\lib\site-packages\TTS\tts\models\vits.py", line 33, in <module>
    from TTS.tts.utils.text.characters import BaseCharacters, BaseVocabulary, _characters, _pad, _phonemes, _punctuations
  File "M:\audio-webui\audio-webui\venv\lib\site-packages\TTS\tts\utils\text\__init__.py", line 1, in <module>
    from TTS.tts.utils.text.tokenizer import TTSTokenizer
  File "M:\audio-webui\audio-webui\venv\lib\site-packages\TTS\tts\utils\text\tokenizer.py", line 5, in <module>
    from TTS.tts.utils.text.phonemizers import DEF_LANG_TO_PHONEMIZER, get_phonemizer_by_name
  File "M:\audio-webui\audio-webui\venv\lib\site-packages\TTS\tts\utils\text\phonemizers\__init__.py", line 5, in <module>
    from TTS.tts.utils.text.phonemizers.ja_jp_phonemizer import JA_JP_Phonemizer
  File "M:\audio-webui\audio-webui\venv\lib\site-packages\TTS\tts\utils\text\phonemizers\ja_jp_phonemizer.py", line 3, in <module>
    from TTS.tts.utils.text.japanese.phonemizer import japanese_text_to_phonemes
  File "M:\audio-webui\audio-webui\venv\lib\site-packages\TTS\tts\utils\text\japanese\phonemizer.py", line 10, in <module>
    raise ImportError("Japanese requires mecab-python3 and unidic-lite.") from e
ImportError: Japanese requires mecab-python3 and unidic-lite.
Japanese requires mecab-python3 and unidic-lite.
gitmylo commented 1 year ago

This seems to be an issue with TTS, maybe something updated? A possibly related pull request is https://github.com/coqui-ai/TTS/pull/2776

zxchcyc commented 1 year ago

got the same issue. how to solve it?

gitmylo commented 1 year ago

I believe something's wrong with the new update of the TTS library, i can lock it to an older version for now.

molander commented 1 year ago

This seemed to be happening in my install yesterday due to the fact that I use conda and it got re-activated. Or maybe that's what allowed me to squeek through by changing my conda env to the install dir's venv, manually installing mecab-python3 and away it went. Awesome project btw, thanks!

gitmylo commented 1 year ago

Please tell me if this didn't fix it, it should get it to install TTS with the japanese "optional" requirements, which aren't actually optional since they're still imported.

pacohernandezg commented 1 year ago

I got the same issue. I solved with:

pip install mecab-python3 pip install unidic-lite

dave-mitchell commented 1 year ago

This install didn't fix it for me. I manually installed both packages installed and I'm still getting the error.

gitmylo commented 1 year ago

This install didn't fix it for me. I manually installed both packages installed and I'm still getting the error.

Make sure it's installed in your venv, not your global python

You can activate your venv by running:

Also, have they still not fixed the requirements?

dave-mitchell commented 1 year ago

Yes, I installed everything to my venv and the error still came up. I verified by trying to re-install and getting the "dependency already satisfied" output.

gitmylo commented 1 year ago

Yes, I installed everything to my venv and the error still came up. I verified by trying to re-install and getting the "dependency already satisfied" output.

Try installing TTS[ja]