EOFError randomly appeared while using PYTTSX and my code now constantly throws this error? It worked fine hours before

≡放荡痞女 提交于 2019-12-07 09:20:57

问题


I was using PYTTSX yesterday with no issues at all - it was acting exactly as expected and working fine. However, when I tried to run the exact same code not two hours later it threw this error:

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

and it has been throwing this error ever since. The code which was working fine before hasn't been changed at all, and the same code works fine on my Linux partition, this error seems to be windows exclusive. Any idea what it could be?


回答1:


It is a simple procedure:

  1. Go to python27 folder
  2. Search for dicts.dat
  3. Delete that folder

It will work because I have done it



来源:https://stackoverflow.com/questions/34065093/eoferror-randomly-appeared-while-using-pyttsx-and-my-code-now-constantly-throws

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!