0

This is the code

import pyttsx3



MASTER= "sir"
engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[0].id)

#speack function will pronunce the string which is passed to it 
def speak(text):
    engine.say(text)
    engine.runAndWait()
speak("initiziling ")

After I run the command, i get this. I dont know why i am getting this but it is really frustrating

  return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\lucky\AppData\Local\Programs\Python\Python38\lib\site-packages\pyttsx3\drivers\sapi5.py", line 10, in <module>
    import pythoncom
ModuleNotFoundError: No module named 'pythoncom'
PS C:\Users\lucky\Desktop\python\.vscode>

please help me

1 Answers1

1

pythoncom is a standard package that comes with pywin32. If you are on windows, you can just use:

pip install pywin32

Also, you could have found it on this question : ImportError: No module named pythoncom

Hope that helps.

Naazneen Jatu
  • 526
  • 9
  • 19