ModuleNotFoundError: 没有名为 'pyttsx3.drivers.sapi5 的模块

时间:2021-01-17 19:03:22

标签: python pyinstaller modulenotfounderror pyttsx3

我正在尝试运行此代码,但由于某种原因它给了我这个错误:

 File "main.py", line 35, in <module>
    engine = pyttsx3.init()
  File "pyttsx3\__init__.py", line 22, in init
  File "pyttsx3\engine.py", line 30, in __init__
  File "pyttsx3\driver.py", line 50, in __init__
  File "importlib\__init__.py", line 127, in import_module
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'pyttsx3.drivers.sapi5'

我通过执行 pyinstaller --onefile --hidden-import=pyttsx3.drivers main.py 进行了修复,但现在出现此错误 ModuleNotFoundError: No module named 'pyttsx3.drivers.sapi5'。有人可以帮忙吗?

0 个答案:

没有答案