Packp3d WX Error

Hi Everyone,

Here’s the error I get after I compile my program using packp3d (with -r wx). I’m not sure what to do at this point, I have been trying for hours :slight_smile:.

:AppRunner: Total Panda3D disk space used: 211 MB
:AppRunner: Configured max usage is: 2048 MB
Traceback (most recent call last):
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 424, in __taskChainDispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 482, in __dispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\AppRunner.py", line 748, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "H:\Documents\Eclipse\SpaceGame\client\main.py", line 26, in <module>
    import wx
  File "VFSImporter", line 446, in load_module
ImportError
:task(error): Exception occurred in PythonTask Messenger-default
Traceback (most recent call last):
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\AppRunner.py", line 638, in run
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\task\Task.py", line 502, in run
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\task\Task.py", line 460, in step
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 424, in __taskChainDispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 482, in __dispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\AppRunner.py", line 748, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "H:\Documents\Eclipse\SpaceGame\client\main.py", line 26, in <module>
    import wx
  File "VFSImporter", line 446, in load_module
ImportError
Failure on startup.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Setting working directory: C:\Users\danf\AppData\Local\Panda3D\start
Command line: "C:\Users\danf\AppData\Local\Panda3D\hosts\runtime.panda3d.org_0f5faf88846080ae\panda3d\cmu_1.8\p3dpythonw.exe" "C:\Users\danf\AppData\Local/Panda3D/hosts/runtime.panda3d.org_0f5faf88846080ae/panda3d/cmu_1.8/panda3d.cmu_1.8.win32.mf" "000000F0" "000000FC" "0"
notify: onpluginload 
notify: onauth 
notify: ondownloadbegin 
notify: ondownloadcomplete 
notify: onready 
notify: onpythonstop 
finish_instance: 00A9B4B8
Assigning 00A9B4B8->log_pathname = C:\Users\danf\AppData\Local/Panda3D/log/tSpace.log

If anyone has any idea it would be apriciated. Thanks.

Hi everyone,

I have found this same issue on the buglist. Hopefully it will be looked at. If anyone knows any workarounds that would be great, maybe downgrade something? Thanks.

Hi Everyone,

Just wondering if anyone knows how to use my local copy of wx instead of the -r wx when packing?

Thanks.

You need to add the appropriate things to sys.path in the .pdef file. But it’s tricky to get that right.

Thanks,

Here’s my feeble attempt so far:

import sys
# add the working directory to the path so local files and modules can be found
sys.path.insert(0,'.')
sys.path.insert(1,'C:\Panda3D-1.8.1\python\Lib\site-packages\wx-2.8-msw-unicode\wx')
sys.path.insert(2,'C:\Panda3D-1.8.1\python\Lib\site-packages\wx-2.8-msw-unicode\wxPython')
 
class tSpace(p3d):
    require('panda3d', 'wx') # include some other packages
 
    config( 
        version="0.1", 
        display_name="tSpace") 
 
    module('core.*', 'pyMap3D') # include the python package core, and its submodules
    #dir('data',newDir='data') # include a folder called data
    mainModule('main') # include and set the main module that runs when the p3d is run
    #file('events.txt') # include a text file

No luck yet, any hints?

Ok, getting a little closer I think:

# add the working directory to the path so local files and modules can be found
sys.path.insert(0,'.')
sys.path.insert(0,'C:\Panda3D-1.8.1\python\Lib\site-packages\wx-2.8-msw-unicode\wx')
sys.path.insert(0,'C:\Panda3D-1.8.1\python\Lib\site-packages\wx-2.8-msw-unicode\wxPython')
sys.path.insert(0,'C:\Panda3D-1.8.1\python\Lib')
 
class tSpace(p3d):
    require('panda3d', 'wx') # include some other packages
 
    config( 
        version="0.1", 
        display_name="tSpace") 
 
    module('core.*') # include the python package core, and its submodules
    module('wx.*')
    module('asyncore')
    module('asynchat')
    #dir('data',newDir='data') # include a folder called data
    mainModule('main') # include and set the main module that runs when the p3d is run
    #file('events.txt') # include a text file

But I get: AttributeError: ‘module’ object has no attribute ‘Frame’ (Can’t use the wx.Frame class I guess)

Why are you depending on the ‘wx’ package but at the same time including the wx modules?

Not sure really. What should the file look like in order to use my own copy of wx? Thanks!

Ended up compiling with py2exe.