本人Python萌新
源程序:
import pyttsx3
engine = pyttsx3.init()
engine.say(entryName.get())
engine.runAndWait()
以下是报错信息:
Exception in Tkinter callback
Traceback (most recent call last):
File "D:gan_pyvenvScriptspython.exelibsite-packagespyttsx3__init__.py", line 20, in init
eng = _activeEngines[driverName]
File "C:UsersAdministratorAppDataLocalProgramsPythonPython37libweakref.py", line 137, in __getitem__
o = self.data[key]()
KeyError: None
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:UsersAdministratorAppDataLocalProgramsPythonPython37libtkinter__init__.py", line 1705, in __call__
return self.func(*args)
File "D:/code/venv/1.py", line 63, in addInformation
engine = pyttsx3.init()
File "D:gan_pyvenvScriptspython.exelibsite-packagespyttsx3__init__.py", line 22, in init
eng = Engine(driverName, debug)
File "D:gan_pyvenvScriptspython.exelibsite-packagespyttsx3engine.py", line 30, in __init__
self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
File "D:gan_pyvenvScriptspython.exelibsite-packagespyttsx3driver.py", line 50, in __init__
self._module = importlib.import_module(name)
File "C:UsersAdministratorAppDataLocalProgramsPythonPython37libimportlib__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "D:gan_pyvenvScriptspython.exelibsite-packagespyttsx3driverssapi5.py", line 3, in <module>
import win32com.client
File "D:PyCharm 2019.2.2helperspydev_pydev_bundlepydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "D:gan_pyvenvScriptspython.exelibsite-packageswin32com__init__.py", line 5, in <module>
import win32api, sys, os
File "D:PyCharm 2019.2.2helperspydev_pydev_bundlepydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ImportError: DLL load failed: 找不到指定的程序。