Home > Blockchain >  Python "No Module named gTTS" after installing it using pip
Python "No Module named gTTS" after installing it using pip

Time:10-23

I have gTTS installed using pip but it shows "No Module named gTTS" during execution. It works fine on Jupyter but doesn't work on CMD. I have added the path to anaconda package where gTTS is installed but it still doesn't work.

CodePudding user response:

You likely did something like this when importing: import gtts

Instead, import it like this:

from gtts import gTTs

or

from gtts import gTTS

CodePudding user response:

Could you make sure you installed the gTTS package correctly in your environment?

pip install gTTS

or

python -m pip install gTTS

Then importing libraries;

from gtts import gTTS
import IPython

Implement:

tts = gTTS("how are you", lang = 'en')

This has worked on my side.

  • Related