1

When I try to run this code:

import pyttsx3

engine = pyttsx3.init()
engine.say("I will speak this text")
engine.runAndWait()

I get this error message:

Exception has occurred: NameError name 'sion' is not defined

During handling of the above exception, another exception occurred:

File "C:\Users\maria\OneDrive\Documents\VirtualAssistant\assistanttest.py", line 3, in <module>

engine = pyttsx3.init()

It was working fine a week ago. I've already tried uninstalling and reinstalling pyttsx3 and I've ran pip install --upgrade wheel.

Henry
  • 3,472
  • 2
  • 12
  • 36
Mariah
  • 21
  • 1
  • Which python version and pyttsx3 version are you using? (To check the pyttsx3 version run `pip list` and look for the number next to it) – Henry May 26 '22 at 01:42
  • Python version 3.10.4 and pyttsx3 version 2.9. – Mariah May 26 '22 at 01:44
  • Have you tried [this answer](https://stackoverflow.com/a/64133684)? Downgrading the version might fix it. – Henry May 26 '22 at 01:47
  • I did unfortunately it did not work. – Mariah May 26 '22 at 01:52
  • Judging from some other answers it may be that the library does not work with newer versions of python. I've got it working on 3.8.2 so maybe you just need an earlier python version. – Henry May 26 '22 at 01:58
  • WOW that worked. Didn't even think to do that because of it working before. Thanks so much! – Mariah May 26 '22 at 02:09

0 Answers0