I notice that you aren't including wx in your package. If I don't include it, everything works fine, but the person running the code would have to install wxPython on their own. It would be so much more convenient to bundle the version of wx in there, so that it just works.
I run "py2applet -p wx --make-setup script.py", and it includes wx in the distribution, but when I start up the program it can't find wx.
I also have tried add --site-packages, which also adds wx to the distribution, but it also doesn't run.
Does anyone have any examples where they bundles wx into the app?
You shouldn't have to explicitly include wx in the setup.py file if your program has an 'import wx' in it somewhere then it should be automatically picked up and included unless you tell it not to bundle external libraries.
My setup file that bundles everything into a standalone app bundle can be found here:
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
Regards,
Cody Precord
···
On Dec 13, 2007, at 7:44 AM, James Bigler wrote:
On Dec 12, 2007, at 1:37 PM, Christopher Barker wrote:
I notice that you aren't including wx in your package.
You shouldn't have to explicitly include wx in the setup.py file if your program has an 'import wx' in it somewhere then it should be automatically picked up
Exactly. That's the whole point of py2app -- and it does a very good job of it. With complex packages, it can make mistakes, but the common ones have "recipes" built in to py2app -- I'm pretty sure wx is one of the standard recipes, so it does "just work".
Well it didn't "just work" with python 2.3, wx 2.5.3.1 (installed by ???) on 10.4. I failed to install the wx package in the app.
I inherited this machine, so I don't know the provenance of the wx installation.
I installed wxPython 2.8.6, but that didn't work for some reason.
I ended up installing MacPython 2.5 and wxP 2.8.7. It didn't work at first for two reasons:
1. wxversion doesn't work, because it can't find the bundled wx. This was a feature I added after installing wxP 2.8.6 for python 2.3.
2. (after fixing 1 by removing it), I needed to recompile my modules for python 2.5.
I now "just works". My app even runs on tiger.
As is often the case with python -- if it doesn't work, you're probably trying too hard!
Well, I'm glad it works now. But I don't know why it had trouble with my original configuration.
The example I gave you does create a completely stand-alone application, it's been tested on PPC and Intel machines with nothing extra installed.