Import Error with packaged wxWidgets app

Bug #765463 reported by Kenneth Bogert
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Panda3D
Won't Fix
Undecided
rdb

Bug Description

The following program:

import wx

app = wx.App(False) # Create a new app, don't redirect stdout/stderr to a window.
frame = wx.Frame(None, wx.ID_ANY, "Hello World") # A Frame is a top-level window.
frame.Show(True) # Show the frame.
app.MainLoop()

when packaged with "packp3d -o test.p3d -r wx" produces the following error when run with panda3d:

:AppRunner: Total Panda3D disk space used: 218 MB
:AppRunner: Configured max usage is: 2048 MB
Traceback (most recent call last):
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 415, in __taskChainDispatch
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 473, in __dispatch
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/p3d/AppRunner.py", line 745, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "/home/kbogert/Projects/NERVE/panda3d/test.py", line 1, 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 "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/p3d/AppRunner.py", line 636, in run
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/task/Task.py", line 502, in run
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/task/Task.py", line 460, in step
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 415, in __taskChainDispatch
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 473, in __dispatch
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/p3d/AppRunner.py", line 745, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "/home/kbogert/Projects/NERVE/panda3d/test.py", line 1, in <module>
    import wx
  File "VFSImporter", line 446, in load_module
ImportError
Successfully joined thread: 0
Failure on startup.

I have wxWidgets 2.8 installed, application runs normally non-packaged.

Revision history for this message
Kenneth Bogert (kbogert-uga) wrote :

Identical behavior on OSX

Revision history for this message
Craig Macomber (craigm) wrote :

I have confirmed the issue in Panda 1.8 on Mac with a slightly simpler setup. I have also confirmed that it works correctly on windows.

The wx package is throwing an error on import!

Entire code in main.py: "import wx"

And a pdef file to build:
class Test(p3d):
    require('morepy','panda3d','wx')
    mainModule('main')

Produces:
Traceback (most recent call last):
  File "/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 424, in __taskChainDispatch
  File "/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 482, in __dispatch
  File "/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/p3d/AppRunner.py", line 748, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "/Users/craigmacomber/Desktop/LinuxShare/ZiCAD/wxTest/main.py", line 1, 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 "/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/p3d/AppRunner.py", line 638, in run
  File "/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/task/Task.py", line 502, in run
  File "/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/task/Task.py", line 460, in step
  File "/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 424, in __taskChainDispatch
  File "/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 482, in __dispatch
  File "/Users/buildbot/slave/release_rtdist_osx/build/panda3d/built_cmu/direct/p3d/AppRunner.py", line 748, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "/Users/craigmacomber/Desktop/LinuxShare/ZiCAD/wxTest/main.py", line 1, in <module>
    import wx
  File "VFSImporter", line 446, in load_module
ImportError

Revision history for this message
rdb (rdb) wrote :

Yeah, it is. I didn't forget to upgrade it for Python 2.7. I don't understand; looking at the import.xml, everything is in place:
http://runtime.panda3d.org/wx/cmu_1.8/osx_i386/wx.cmu_1.8.osx_i386.import.xml

I'll need to investigate deeper.

Changed in panda3d:
assignee: nobody → rdb (rdb)
Revision history for this message
Dan Forsyth (danf) wrote :

Hi Guys,

Having the same issue over here. wx.2.8.12.1, Panda-1.8.1, Windows 7 64bit. Doesn't look like there is much chatter on this lately. Perhaps anyone knows of a workaround with a different version of WX or Panada?

Thanks.

Revision history for this message
rdb (rdb) wrote :

Well, the wx-on-OSX issue is caused by an absolute path in the library dependency. That can't be the issue on Windows.

The wx version you have on your system doesn't really matter, actually. Panda ships its own version of wx that's packaged in https://runtime.panda3d.org/wx/cmu_1.8/win32/ and downloaded by the runtime when you run your game. There must be something wrong with that build.

You're not really giving a lot of information to go on, though. At the very least a console output would be helpful, but trying out some different ways of importing wx or wx-related modules would also be appreciated.

Revision history for this message
Dan Forsyth (danf) wrote : RE: [Bug 765463] Re: Import Error with packaged wxWidgets app
Download full text (3.7 KiB)

Thanks for looking at this, it's appreciated.

I will first try a base WX program not my source and let you know the results.

What do you mean console output? You mean the output when I run the application right?

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of rdb
Sent: Tuesday, December 03, 2013 2:18 PM
To: Dan Forsyth
Subject: [Bug 765463] Re: Import Error with packaged wxWidgets app

Well, the wx-on-OSX issue is caused by an absolute path in the library dependency. That can't be the issue on Windows.

The wx version you have on your system doesn't really matter, actually.
Panda ships its own version of wx that's packaged in https://runtime.panda3d.org/wx/cmu_1.8/win32/ and downloaded by the runtime when you run your game. There must be something wrong with that build.

You're not really giving a lot of information to go on, though. At the very least a console output would be helpful, but trying out some different ways of importing wx or wx-related modules would also be appreciated.

--
You received this bug notification because you are subscribed to the bug report.
https://bugs.launchpad.net/bugs/765463

Title:
  Import Error with packaged wxWidgets app

Status in Panda3D:
  New

Bug description:
  The following program:

  import wx

  app = wx.App(False) # Create a new app, don't redirect stdout/stderr to a window.
  frame = wx.Frame(None, wx.ID_ANY, "Hello World") # A Frame is a top-level window.
  frame.Show(True) # Show the frame.
  app.MainLoop()

  when packaged with "packp3d -o test.p3d -r wx" produces the following
  error when run with panda3d:

  :AppRunner: Total Panda3D disk space used: 218 MB
  :AppRunner: Configured max usage is: 2048 MB
  Traceback (most recent call last):
    File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 415, in __taskChainDispatch
    File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 473, in __dispatch
    File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/p3d/AppRunner.py", line 745, in __startIfReady
    File "VFSImporter", line 153, in load_module
    File "/home/kbogert/Projects/NERVE/panda3d/test.py", line 1, 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 "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/p3d/AppRunner.py", line 636, in run
    File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/task/Task.py", line 502, in run
    File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/task/Task.py", line 460, in step
    File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 415, in __taskChainDispatch
    File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 473, i...

Read more...

Revision history for this message
rdb (rdb) wrote :
Download full text (6.8 KiB)

Well, I'll be damned. I put "import wx" into a file called main.py, ran
"packp3d -o test.p3d -r wx", ran the resulting test.p3d, and it failed at
"import wx". Hmm.

-- Reinier de Blois

On 3 December 2013 21:48, Dan Forsyth <email address hidden> wrote:

> Thanks for looking at this, it's appreciated.
>
> I will first try a base WX program not my source and let you know the
> results.
>
> What do you mean console output? You mean the output when I run the
> application right?
>
> -----Original Message-----
> From: <email address hidden> [mailto:<email address hidden>] On Behalf Of
> rdb
> Sent: Tuesday, December 03, 2013 2:18 PM
> To: Dan Forsyth
> Subject: [Bug 765463] Re: Import Error with packaged wxWidgets app
>
> Well, the wx-on-OSX issue is caused by an absolute path in the library
> dependency. That can't be the issue on Windows.
>
> The wx version you have on your system doesn't really matter, actually.
> Panda ships its own version of wx that's packaged in
> https://runtime.panda3d.org/wx/cmu_1.8/win32/ and downloaded by the
> runtime when you run your game. There must be something wrong with that
> build.
>
> You're not really giving a lot of information to go on, though. At the
> very least a console output would be helpful, but trying out some
> different ways of importing wx or wx-related modules would also be
> appreciated.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/765463
>
> Title:
> Import Error with packaged wxWidgets app
>
> Status in Panda3D:
> New
>
> Bug description:
> The following program:
>
> import wx
>
> app = wx.App(False) # Create a new app, don't redirect stdout/stderr to
> a window.
> frame = wx.Frame(None, wx.ID_ANY, "Hello World") # A Frame is a
> top-level window.
> frame.Show(True) # Show the frame.
> app.MainLoop()
>
> when packaged with "packp3d -o test.p3d -r wx" produces the following
> error when run with panda3d:
>
> :AppRunner: Total Panda3D disk space used: 218 MB
> :AppRunner: Configured max usage is: 2048 MB
> Traceback (most recent call last):
> File
> "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/showbase/Messenger.py",
> line 415, in __taskChainDispatch
> File
> "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/showbase/Messenger.py",
> line 473, in __dispatch
> File
> "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/p3d/AppRunner.py",
> line 745, in __startIfReady
> File "VFSImporter", line 153, in load_module
> File "/home/kbogert/Projects/NERVE/panda3d/test.py", line 1, 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
> "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/p3d/AppRunner.py",
> line 636, in run
> File
> "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/task/Task.py",
> line 502, in run
> File
> "/home/buildbot/slave/release...

Read more...

Revision history for this message
Dan Forsyth (danf) wrote :
Download full text (10.3 KiB)

Thanks again for looking at this, you have made my Christmas. I really like your deployment system, you guys have done a great job with Panda3D.

Do you need me to check on anything over here?

Also, is there a place where I can send a donation to your team?

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of rdb
Sent: Tuesday, December 03, 2013 4:24 PM
To: Dan Forsyth
Subject: Re: [Bug 765463] Re: Import Error with packaged wxWidgets app

Well, I'll be damned. I put "import wx" into a file called main.py, ran "packp3d -o test.p3d -r wx", ran the resulting test.p3d, and it failed at "import wx". Hmm.

-- Reinier de Blois

On 3 December 2013 21:48, Dan Forsyth <email address hidden> wrote:

> Thanks for looking at this, it's appreciated.
>
> I will first try a base WX program not my source and let you know the
> results.
>
> What do you mean console output? You mean the output when I run the
> application right?
>
> -----Original Message-----
> From: <email address hidden> [mailto:<email address hidden>] On Behalf
> Of rdb
> Sent: Tuesday, December 03, 2013 2:18 PM
> To: Dan Forsyth
> Subject: [Bug 765463] Re: Import Error with packaged wxWidgets app
>
> Well, the wx-on-OSX issue is caused by an absolute path in the library
> dependency. That can't be the issue on Windows.
>
> The wx version you have on your system doesn't really matter, actually.
> Panda ships its own version of wx that's packaged in
> https://runtime.panda3d.org/wx/cmu_1.8/win32/ and downloaded by the
> runtime when you run your game. There must be something wrong with
> that build.
>
> You're not really giving a lot of information to go on, though. At
> the very least a console output would be helpful, but trying out some
> different ways of importing wx or wx-related modules would also be
> appreciated.
>
> --
> You received this bug notification because you are subscribed to the
> bug report.
> https://bugs.launchpad.net/bugs/765463
>
> Title:
> Import Error with packaged wxWidgets app
>
> Status in Panda3D:
> New
>
> Bug description:
> The following program:
>
> import wx
>
> app = wx.App(False) # Create a new app, don't redirect
> stdout/stderr to a window.
> frame = wx.Frame(None, wx.ID_ANY, "Hello World") # A Frame is a
> top-level window.
> frame.Show(True) # Show the frame.
> app.MainLoop()
>
> when packaged with "packp3d -o test.p3d -r wx" produces the following
> error when run with panda3d:
>
> :AppRunner: Total Panda3D disk space used: 218 MB
> :AppRunner: Configured max usage is: 2048 MB
> Traceback (most recent call last):
> File
> "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cm
> u/direct/showbase/Messenger.py",
> line 415, in __taskChainDispatch
> File
> "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cm
> u/direct/showbase/Messenger.py",
> line 473, in __dispatch
> File
> "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cm
> u/direct/p3d/AppRunner.py",
> line 745, in __startIfReady
> File "VFSImpo...

Revision history for this message
Dan Forsyth (danf) wrote :

Hi Guys,

Just wondering if there is any timeline on this? Thanks!

Revision history for this message
Dan Forsyth (danf) wrote :

Tried to compile it with Panda3D 1.8.0 instead of 1.8.1, but seems like the same error. Just thought I would try. :-)

rdb (rdb)
tags: added: packaging wx
tags: added: macos
Revision history for this message
rdb (rdb) wrote :

packp3d is no longer supported in 1.10 (in favour of the new setuptools-based deployment system), so I'm closing this. Please file an issue on GitHub if the issue still persists with deploy-ng.

Changed in panda3d:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.