ModuleNotFoundError: No module named 'engine' while running pyttsx
Question:
When I run this code I always get this error: ModuleNotFoundError: No module named 'engine'
.
import pyttsx
engine = pyttsx.init()
engine.say('hello world')
Does anyone know why this is happening and how to fix it?
Answers:
The Python "ModuleNotFoundError: No module named ‘click’" occurs when we forget to install the click module before importing it or install it in an incorrect environment. To solve the error, install the module by running the pip install click command.
Use pyttsx3
package instead that supports both python 2 and 3. You can install it for example with pip install pyttsx3
on your system.
import pyttsx3
engine = pyttsx3.init()
engine.say("hello world")
engine.runAndWait()
you have to use import pyttsx3
use import pyttsx3
. pyttsx
is a older version.
When I run this code I always get this error: ModuleNotFoundError: No module named 'engine'
.
import pyttsx
engine = pyttsx.init()
engine.say('hello world')
Does anyone know why this is happening and how to fix it?
The Python "ModuleNotFoundError: No module named ‘click’" occurs when we forget to install the click module before importing it or install it in an incorrect environment. To solve the error, install the module by running the pip install click command.
Use pyttsx3
package instead that supports both python 2 and 3. You can install it for example with pip install pyttsx3
on your system.
import pyttsx3
engine = pyttsx3.init()
engine.say("hello world")
engine.runAndWait()
you have to use import pyttsx3
use import pyttsx3
. pyttsx
is a older version.