我正在使用pyhook和pythoncom编译一些python脚本。在通知pyHook.cpyHook中缺少名为_cpyHook的模块后,构建成功。当我启动.exe文件时,它返回此导入错误。
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\pyHook\cpyHook.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_cpyHook', [dirname(__file__)])
File "C:\Python34\Lib\imp.py", line 297, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_cpyHook'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "app.py", line 17, in <module>
File "E:\projects\pykalappai\EkEngine\Engine.py", line 3, in <module>
import pyHook
File "C:\Python34\Lib\site-packages\pyHook\__init__.py", line 1, in <module>
from .HookManager import *
File "C:\Python34\Lib\site-packages\pyHook\HookManager.py", line 1, in <module>
from . import cpyHook
File "C:\Python34\Lib\site-packages\pyHook\cpyHook.py", line 28, in <module>
_cpyHook = swig_import_helper()
File "C:\Python34\Lib\site-packages\pyHook\cpyHook.py", line 20, in swig_import_helper
import _cpyHook
ImportError: No module named '_cpyHook'
我已经搜索了这个并尝试了这些解决方案,如
这些都不适合我。
答案 0 :(得分:0)
我遇到了同样的问题。
在编译之前,将_cpyHook.pyd
和cpyHook.py
文件从"c:\PythonXX\Lib\site-packages\pyHook"
复制到"c:\PythonXX\Lib\site-packages"
,然后进行编译即可。