无法运行exe Pyinstaller和pyttsx

时间:2019-02-03 04:36:27

标签: python pyinstaller py2exe pyttsx

这是程序的代码

import pyttsx3

engine = pyttsx3.init()
engine.say("Hi!")
engine.runAndWait()

这是pyinstaller从py转换为exe文件后产生的错误。

Traceback (most recent call last):
  File "site-packages\pyttsx3\__init__.py", line 44, in init
  File "c:\users\shahiryar\appdata\local\programs\python\python36-32\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 "p3.py", line 3, in <module>
  File "site-packages\pyttsx3\__init__.py", line 46, in init
  File "site-packages\pyttsx3\engine.py", line 52, in __init__
  File "site-packages\pyttsx3\driver.py", line 77, in __init__
  File "site-packages\pyttsx3\drivers\sapi5.py", line 22, in buildDriver
  File "site-packages\pyttsx3\drivers\sapi5.py", line 41, in __init__
  File "site-packages\pyttsx3\drivers\sapi5.py", line 83, in setProperty
  File "site-packages\win32com\client\dynamic.py", line 549, in __setattr__
pywintypes.com_error: (-2147352573, 'Member not found.', None, None)
[9248] Failed to execute script p3

0 个答案:

没有答案