使用 PYTTSX 时随机出现 EOFError 并且我的代码现在不断抛出此错误?它在几个小时前运行良好 [英] EOFError randomly appeared while using PYTTSX and my code now constantly throws this error? It worked fine hours before

查看:38
本文介绍了使用 PYTTSX 时随机出现 EOFError 并且我的代码现在不断抛出此错误?它在几个小时前运行良好的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我昨天使用 PYTTSX 没有任何问题 - 它的行为完全符合预期并且工作正常.但是,当我在不到两个小时后尝试运行完全相同的代码时,它抛出了这个错误:

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

从那以后它一直在抛出这个错误.之前运行良好的代码根本没有改变,同样的代码在我的 Linux 分区上运行良好,这个错误似乎是 windows 独有的.知道它可能是什么吗?

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. 转到python27文件夹
  2. 搜索 dicts.dat
  3. 删除那个文件夹

它会起作用,因为我已经做到了

It will work because I have done it

这篇关于使用 PYTTSX 时随机出现 EOFError 并且我的代码现在不断抛出此错误?它在几个小时前运行良好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆