1

我试图运行这段代码,但由于某种原因它给了我这个错误:

 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'。任何人都可以帮忙吗?

4

0 回答 0