我昨天在使用 PYTTSX 时完全没有问题——它的表现完全符合预期并且工作正常。但是,当我尝试在两个小时后运行完全相同的代码时,它抛出了这个错误:
Traceback (most recent call last):
File "C:\Python27\FUCK.py", line 2, in <module>
engine = pyttsx.init()
File "C:\Python27\lib\site-packages\pyttsx\__init__.py", line 39, in init
eng = Engine(driverName, debug)
File "C:\Python27\lib\site-packages\pyttsx\engine.py", line 45, in __init__
self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
File "C:\Python27\lib\site-packages\pyttsx\driver.py", line 64, in __init__
self._module = __import__(name, globals(), locals(), [driverName])
File "C:\Python27\lib\site-packages\pyttsx\drivers\sapi5.py", line 19, in <module>
import win32com.client
File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line 11, in <module>
import gencache
File "C:\Python27\lib\site-packages\win32com\client\gencache.py", line 662, in <module>
__init__()
File "C:\Python27\lib\site-packages\win32com\client\gencache.py", line 56, in __init__
_LoadDicts()
File "C:\Python27\lib\site-packages\win32com\client\gencache.py", line 109, in _LoadDicts
version = p.load()
EOFError
从那以后它一直在抛出这个错误。之前运行良好的代码根本没有改变,同样的代码在我的 Linux 分区上运行良好,这个错误似乎是 windows 独有的。知道它可能是什么吗?