py2exe wxversion.checkInstalled / error building MediaCtrl

5 views
Skip to first unread message

Steven Sproat

unread,
Nov 29, 2009, 6:54:57 PM11/29/09
to wxPytho...@googlegroups.com
I've had to comment out my wxversion.checkInstalled for my application
to run with Py2EXE. However, I'm building with the correct version
number that I'm checking for, why should this fail?
I found this code here,
http://dialogue-act-editor.googlecode.com/svn/trunk/dae.py - where a
translated comment says how it fails when built with py2exe, but I can't
find any other people with the issue.

It's only a minor issue, but I'm using checkInstalled in two locations
and having to comment them out each time is a nuisance.


I'm also having a lot of trouble getting my MediaCtrl to run. I can
compile my application, but get the following error:

Traceback (most recent call last):
File "gui.py", line 62, in <module>
from whyteboard import Whyteboard
File "zipextimporter.pyo", line 82, in load_module
File "whyteboard.pyo", line 54, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "tools.pyo", line 33, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "panels.pyo", line 28, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "wx\media.pyo", line 8, in <module>
File "zipextimporter.pyo", line 98, in load_module
ImportError: MemoryLoadLibrary failed loading wx\_media.pyd


Googling has revealed that placing the MSVCP71.DLL and msvcr71.dll's
into my applications directory should help, but the same error comes up.

I am using bundle_files=1, however I saw some suggestion online to use
#3. I changed to that, and the application seems to load but a different
traceback comes up.

Traceback (most recent call last):
File "gui.py", line 62, in <module>
from whyteboard import Whyteboard
File "whyteboard.pyo", line 54, in <module>
File "tools.pyo", line 33, in <module>
File "panels.pyo", line 28, in <module>
File "wx\media.pyo", line 8, in <module>
File "wx\_media.pyo", line 12, in <module>
File "wx\_media.pyo", line 10, in __load
ImportError: DLL load failed: The specified module could not be found.

With bundle=1 the error comes up much quicker than #3. I've ensured both
msvcp/r are included; tried with both capital letters/lowercase. I don't
really know where to go from here, does anyone have any suggestions?

--
Steven Sproat, BSc
http://www.basicrpg.com/

Steven Sproat

unread,
Nov 29, 2009, 8:01:23 PM11/29/09
to wxPytho...@googlegroups.com
Ahem. I am an idiot.
A while ago I excluded many of the DLLs that py2exe was generating to make my application smaller. One of these was the mediactrl, which I overlooked. Dreadfully sorry, I wasted a good 2 hours on this!


2009/11/29 Steven Sproat <spr...@gmail.com>

Cody Precord

unread,
Nov 29, 2009, 11:18:32 PM11/29/09
to wxpytho...@googlegroups.com
Hi,

On Nov 29, 2009, at 7:01 PM, Steven Sproat wrote:

Ahem. I am an idiot.
A while ago I excluded many of the DLLs that py2exe was generating to make my application smaller. One of these was the mediactrl, which I overlooked. Dreadfully sorry, I wasted a good 2 hours on this!


2009/11/29 Steven Sproat <spr...@gmail.com>
I've had to comment out my wxversion.checkInstalled for my application to run with Py2EXE. However, I'm building with the correct version number that I'm checking for, why should this fail?
I found this code here, http://dialogue-act-editor.googlecode.com/svn/trunk/dae.py - where a translated comment says how it fails when built with py2exe, but I can't find any other people with the issue.

It's only a minor issue, but I'm using checkInstalled in two locations and having to comment them out each time is a nuisance


Don't use wxversion in a 'built' program. Guard it by checking sys.frozen.

i.e)

if not hasattr(sys, 'frozen'):
    import wxversion
    do wxversion stuff

This is stated in the docs for wxversion (http://www.wxpython.org/docs/api/wxversion-module.html)


Cody

Reply all
Reply to author
Forward
0 new messages