I was having some problems when using the .getproperty(\'voices\') attribute in pyttsx3. So I decided to uninstall it and then re-install it using PIP to see if that may fix the
I was facing same problem in my project but simply changing the python version from 3.8 to 3.6 works for me.
I don't know if you managed to work around this issue, but I had the same thing this morning and fixed it by downgrading the version of pyttsx3 from the latest to version 2.71.
There seems to be some missing commits with the latest version that haven't been resolved (if you read the thread this post is from)
Open command prompt Write:
pip uninstall pyttsx3
Then:
pip install pyttsx3==2.71
And your problem will solve.
Try instead this:
engine= pyttsx3.init('dummy')
I hope you are trying to install pyttsx3 from https://pypi.org/project/pyttsx3/.
were you able to execute pip install pyttsx3 with out any issues? Are you trying to run the above code from jupyter? if yes then, please don't run the complete code at a time i.e the below code
import pyttsx3
engine = pyttsx3.init()
engine.say("I will speak this text")
engine.runAndWait()
first run import pyttsx3
alone and thern try to put up your code one by one.
I have faced similar issue earlier many times while running it on diferent systems.
I don't know why this issue shows up but the above steps will surely do resolve the issue.
You need to provide a driver key argument to init. 'dummy' or 'sapi5' would work.
engine = pyttsx3.init('dummy')
or
engine = pyttsx3.init('sapi5')