Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
indubwestep opened this issue Jul 31, 2023 · 10 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@indubwestep
Copy link

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.
@indubwestep indubwestep added the bug Something isn't working label Jul 31, 2023
@gitmylo
Copy link
Owner

gitmylo commented Jul 31, 2023

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

@zxchcyc
Copy link

zxchcyc commented Aug 1, 2023

got the same issue. how to solve it?

@gitmylo
Copy link
Owner

gitmylo commented Aug 1, 2023

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

@molander
Copy link

molander commented Aug 1, 2023

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 gitmylo closed this as completed in b5f8915 Aug 1, 2023
@gitmylo
Copy link
Owner

gitmylo commented Aug 1, 2023

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
Copy link

I got the same issue. I solved with:

pip install mecab-python3
pip install unidic-lite

@dave-mitchell
Copy link

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

@gitmylo
Copy link
Owner

gitmylo commented Aug 5, 2023

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:

  • Windows: call venv\Scripts\activate.bat
  • Linux/MacOS: source venv/bin/activate

Also, have they still not fixed the requirements?

@dave-mitchell
Copy link

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
Copy link
Owner

gitmylo commented Aug 5, 2023

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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants