本人Python萌新
源程序:
import pyttsx3
engine = pyttsx3.init()
engine.say(entryName.get())
engine.runAndWait()
以下是报错信息:
Exception in Tkinter callback
Traceback (most recent call last):
File "D:\gan_py\venv\Scripts\python.exe\lib\site-packages\pyttsx3\__init__.py", line 20, in init
eng = _activeEngines[driverName]
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\weakref.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:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\tkinter\__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_py\venv\Scripts\python.exe\lib\site-packages\pyttsx3\__init__.py", line 22, in init
eng = Engine(driverName, debug)
File "D:\gan_py\venv\Scripts\python.exe\lib\site-packages\pyttsx3\engine.py", line 30, in __init__
self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
File "D:\gan_py\venv\Scripts\python.exe\lib\site-packages\pyttsx3\driver.py", line 50, in __init__
self._module = importlib.import_module(name)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "D:\gan_py\venv\Scripts\python.exe\lib\site-packages\pyttsx3\drivers\sapi5.py", line 3, in
import win32com.client
File "D:\PyCharm 2019.2.2\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "D:\gan_py\venv\Scripts\python.exe\lib\site-packages\win32com\__init__.py", line 5, in
import win32api, sys, os
File "D:\PyCharm 2019.2.2\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ImportError: DLL load failed: 找不到指定的程序。