I would be shocked if my technique, if used correctly, doesn't work. I
have a program that makes extensive use of the ActiveX Flash wrapper,
and that technique ALWAYS works, and I can bundle just fine.
Do you have these files:
myole4ax.idl
myole4ax.tlb
On the path:
<drive:Python install directory>\Lib\site-packages\wx-2.9.1-msw\wx\lib
If you don't, then you haven't run the wxPython Demo and played
asteroids.
If you have, these files will be picked up by py2exe.
I have had the line "bundle_files" commented out for YEARS, but put it
into the "Setup" function of your py2exe script:
setup(
options = {"py2exe": {"compressed": 1,
"optimize": 2,
"ascii": 1,
"bundle_files": 3,
"packages": ["encodings"],
"includes": ["decimal","shlex","os"],
}
},
zipfile = None,
# console = [program],
bundle_files = [
(r"wx/lib",[r"C:\Python27\Lib\site-packages\wx-2.9.1-msw\wx\lib\myole4ax.idl",r"C:\Python275\Lib\site-packages\wx-2.9.1-msw\wx\lib\myole4ax.tlb"])
]
windows = [program],
)
See if that works.
Chris.
On Thu, 18 Nov 2010 20:45:59 -0800 (PST), Humble Learner > > > > <nava...@gmail.com> wrote:
>I tried what has been recommended by Chris but no luck!!!
>Just want to confirm that is it really work in that way? If not then
>is there any way to pack falshwindow in py2exe? any workaround? I've
>spent so many days on it.
>On Nov 18, 8:35 pm, Robin Dunn <ro...@alldunn.com> wrote:
>> On 11/18/10 7:09 PM, Humble Learner wrote:
>> > Hi Freinds,
>> > I try to build a sample using ActiveX app (like Flash window). I have
>> > following components installed on my windows machine:
>> > py2exe + wx.lib.flashwin + Python 2.7 + wxPython 2.8.11 + comtypes
>> > When I execute it using "python.exe testActivex.py" it works fine and
>> > I'm able to open flash file. So, I tried to generate exe using py2exe
>> > but I got the following error:
>> > 18:57:22: Debug: src/helpers.cpp(140): 'CreateActCtx' failed with
>> > error 0x0000007b (the filename, directory name, or volume label syntax
>> > is incorrect.).
>> > Traceback (most recent call last):
>> > File "testflv.py", line 27, in<module>
>> > File "zipextimporter.pyo", line 82, in load_module
>> > File "wx\lib\flashwin.pyo", line 15, in<module>
>> > File "zipextimporter.pyo", line 82, in load_module
>> > File "wx\lib\activex.pyo", line 44, in<module>
>> > ImportError: cannot import name myole4ax
>> > I have been digging about this since last two days. I've tried to read
>> > whatever I can from comtypes.gen to activex to sys.frozen attributes.
>> > I have also read that myole4ax.tlb was missing in some of the wxPython
>> > versions(can't believe). After spending this much time I'm not able to
>> > resolve the issue.
>> Here's the code in question:
>> import sys, os
>> if not hasattr(sys, 'frozen'):
>> f = os.path.join(os.path.dirname(__file__), 'myole4ax.tlb')
>> cc.GetModule(f)
>> from comtypes.gen import myole4ax
>> The intent is that when the app is running in a non-frozen state (IOW,
>> without py2exe) then it will load the activex component from the same
>> location as activex.py and comtypes will make a module for it in
>> comtypes.gen. When it is running from a frozen app (IOW in a py2ex'd
>> form) then it will just import from comtypes.gen and skip the rest. So
>> basically you need to run the application from source before you can
>> bundle it up with py2exe.
>> > Is there anything wrong with my setup.py. I tried with bundled files =
>> > 3 and 1. My goal is to create one exe only. (i.e. bundled file = 1)
>> You probably won't be able to do that. Things have been reported to
>> work much better in an unbundled state. You can instead use one of the
>> free installer builders to bundle your files into the single .exe that
>> your users can run to install the collection of files.
>> --
>> Robin Dunn
>> Software Craftsmanhttp://wxPython.org-Hide quoted text -
>> - Show quoted text -- Hide quoted text -
- Show quoted text -