WHAT I'M DOING:
I'm trying to run a simple tts program:
import pyttsx3
*** engine = pyttsx3.init()
engine.setProperty("rate", 178)
engine.say("I am the text spoken after changing the speech rate.")
engine.runAndWait()
but I'm getting the following error at the *** line:
Exception has occurred: ModuleNotFoundError No module named 'win32api'
WHAT I'VE TRIED:
- I looked online and found that I should re-install pywin32 (pip install pywin32), which I did, but this problem is still here.
- I've also tried importing win32api directly in the program, but I still get the same error, just at the import line now (***):
import pyttsx3
*** import win32api
engine = pyttsx3.init()
engine.setProperty("rate", 178)
engine.say("I am the text spoken after changing the speech rate.")
engine.runAndWait()
Even weirder is Visual Studio Code sees win32api (the word is green on my IDE), but it still says it doesn't exist?:
I'm really confused so absolutely any help would be greatly appreciated. Thank you.