将cx_freeze与pythoncom一起使用时导入错误 [英] Import Error when using cx_freeze with pythoncom

查看:47
本文介绍了将cx_freeze与pythoncom一起使用时导入错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用python编写了一个简单的键盘记录程序。该程序可与Python Interpreter完美配合。然后,我使用cx_freeze将其转换为可执行文件。

I have made a simple keylogger program in python. The program works perfectly with Python Interpreter. Then, I converted it into an executable using cx_freeze.

现在的问题是存在导入错误。

The problem now is that there are import errors.

我找不到与pythoncom和pywintypes相关的.pyd文件。那么,在哪里可以找到这些文件?令人惊讶的是,当我将pythoncom.py和pywintypes.py复制并粘贴到该文件夹​​中时,该可执行文件有效。

I can't find the relevant .pyd files for pythoncom and pywintypes. So, where can I find these files? The surprising thing is that when I copy and paste pythoncom.py and pywintypes.py into the folder, the executable works.

推荐答案

此问题是在发布cx_Freeze 5.0之后发现的,此后在源代码中已得到解决。下一个或两周将发布一个新版本,但与此同时,您只需将文件cx_Freeze / hooks.py从源复制到安装中即可。可以在这里找到源:

This problem was discovered after the release of cx_Freeze 5.0 and has since been resolved in the source. A new release will be made in the next week or two but in the meantime you can simply copy the file cx_Freeze/hooks.py from the source to your installation. The source can be found here:

https ://bitbucket.org/anthony_tuininga/cx_freeze/src/

这篇关于将cx_freeze与pythoncom一起使用时导入错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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