Help with py2exe error

放肆的年华 提交于 2019-12-12 01:36:26

问题


I'm trying to compile to an exe my script of python, but I'm getting an error that I'm not know how to resolve...

my script include this libraries

import pyHook
import pythoncom
import time
import win32com.client

and the py2exe script is

from distutils.core import setup
import py2exe
import sys

sys.argv.append('py2exe')

setup(
    options = {'py2exe': dict(bundle_files=1, optimize=1)},
    console = ["login.macro.py"],
    zipfile = None,
    )

and I'm getting the error

Traceback (most recent call last):
  File "login.macro.py", line 4, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "win32com\__init__.pyo", line 5, in <module>
  File "zipextimporter.pyo", line 98, in load_module
ImportError: MemoryLoadLibrary failed loading win32api.pyd

How can I solve it?

I've just compiled another script and went everything ok


回答1:


Try bundle_files=3 :

http://mail.python.org/pipermail/python-win32/2009-June/009227.html



来源:https://stackoverflow.com/questions/3089677/help-with-py2exe-error

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