简体   繁体   English

python win32com中的EOFError

[英]EOFError in python win32com

I am running Sympathy for Data, a program based on python. 我正在运行Sympathy for Data,这是一个基于python的程序。 It worked well until today. 它运作良好,直到今天。 I got error message like this: 我收到如下错误信息:

File "..\Python27\lib\site-packages\win32com\client\__init__.py", line 11, in <module>
import gencache
File >"..\Python27\lib\site-packages\win32com\client\gencache.py", line 662, in <module>
_ _init_ _()
File >"..\Python27\lib\site-packages\win32com\client\gencache.py", line 56, in _ _init_ _
_LoadDicts()
File "..\Python27\lib\site-packages\win32com\client\gencache.py", line 109, in _LoadDicts
version = p.load()
EOFError

I find an answer here which basically had the same issue, but the solution doesn't work for me. 在这里找到一个基本上有相同问题的答案,但解决方案对我不起作用。 All the solutions that I've found online provide the same solution, remove the contents under _gen_py_ folder. 我在网上找到的所有解决方案都提供相同的解决方案,删除_gen_py_文件夹下的内容。

I don't have to run any program with Sympathy for data. 我没有必要使用Sympathy运行任何程序来获取数据。 I got this error message even if I open the iPython shipped with Sympathy for data. 即使我打开Sympathy附带的数据的iPython,我也收到了此错误消息。

I am really hopeless in this case, could someone help me how to solve it? 在这种情况下,我真的很无望,有人可以帮我解决这个问题吗?

I had the same problem when I had to reboot the system when it was running a program using win32com. 当我使用win32com运行程序时必须重新启动系统时,我遇到了同样的问题。 I was using an Py2.7 anaconda environment and couldn't find dicts.dat file in my anaconda folder. 我使用的是Py2.7 anaconda环境,在我的anaconda文件夹中找不到dicts.dat文件。 I later found that is is actually stored in a temporary directory \\AppData\\Local\\Temp\\gen_py\\2.7 I deleted that and it solved the error. 我后来发现实际上是存储在临时目录\\AppData\\Local\\Temp\\gen_py\\2.7我删除了它并解决了错误。

I think uninstalling the package using CMD(Administrator) using 我认为使用CMD(管理员)卸载软件包

pip uninstall pywin32 pip uninstall pywin32

and again installing it by collecting new data using no saved cache using 并通过使用没有保存的缓存收集新数据再次安装它

pip --no-cache install pywin32 pip --no-cache安装pywin32

will help you a lot 会帮助你很多

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM