Search code examples
pythonpython-importtraceback

Cannot use the pyttsx3 python module


I was trying to use the python pyttsx3 module to say: "Hi World" , but the program crashed from the beginning onwards.

While trying to run the pyttsx3 programs , returns the following error

The primary error says : cannot import SpeechLib from comtypes.gen

Given Below is the program :

import pyttsx3
engine = pyttsx3.init()
engine.say("Hi World")
engine.runAndWait()

I have installed all the dependencies required for the pyttsx3, but still, it doesn't work? What should I do ?

Proof for "I have all the dependencies installed"

comtypes.gen folder in my pc


Solution

  • follow the link and type as it is from the image, hope it helps