Невозможно инициализировать pyttsx3 с помощью AttributeError - PullRequest
0 голосов
/ 07 мая 2020

Когда я пытаюсь инициализировать pyttsx способом, показанным ниже, я получаю сообщение об ошибке.

import pyttsx
engine = pyttsx3.init()
engine.say("hello user")
engine.runAndWait()

И это отслеживание полученной ошибки:

Traceback (most recent call last):
  File "C:\Users\gajar\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyttsx3\__init__.py", line 20, in init
    eng = _activeEngines[driverName]
  File "C:\Users\gajar\AppData\Local\Programs\Python\Python38-32\lib\weakref.py", line 131, in __getitem__
    o = self.data[key]()
KeyError: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/gajar/PycharmProjects/untitled/App.py", line 3, in <module>
    engine = pyttsx3.init()
  File "C:\Users\gajar\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyttsx3\__init__.py", line 22, in init
    eng = Engine(driverName, debug)
  File "C:\Users\gajar\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyttsx3\engine.py", line 30, in __init__
    self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
  File "C:\Users\gajar\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyttsx3\driver.py", line 52, in __init__
    self._driver = self._module.buildDriver(weakref.proxy(self))
AttributeError: module 'pyttsx3.drivers.sapi5' has no attribute 'buildDriver'
...