py2app doesn't copy .dylib for Phoenix like it did for pre-Phoenix wx

I have an existing app that uses wx2.9 and packages itself up with py2app for a single clickable OSX app. It works fine.

I’ve been migrated my app to wx Phoenix (py3.3 is a new requirement) and have an app that largely works fine under Phoenix/py3.3.

However, my py2app does not create a working application any longer.

Examining the created app, it is not copying the libwx_osx_cocoau-2.9.5.0.0.dylib file into the created application package. With wx2.9, the libwx*dylib was copied into Content/Frameworks by py2app automatically and things worked. With wx Phoenix, it is not copied at all into the package.

Moving it into Content/Frameworks manually doesn’t work–it isn’t found by the application. Moving it manually to /Contents/Resources/lib/python3.3/lib-dynload/wx/libwx_osx_cocoau-2.9.5.0.0.dylib does work.

This isn’t a critical issue for me–I can easily move this file into the application via my build script. However, this is likely to be very confusing for people trying to make standalone apps. I’m uncertain how this stuff works, so I don’t have a good sense if this is a wxPython issue or a py2app issue. Is wx failing to say explicitly enough that the dylib is a dependency? Or did py2app manually and explicitly know to grab the dylib with pre-Phoenix wx?

Thanks!

py2app comes with a "recipe" for wx -- I haven't looked at what's in
it (other than stuff to do pubsub right...) but maybe it's doign
somethign special that needs to be adapted.

But in any case, this is really a py2app issue -- I'd try on the pythonma list.

-Chris

···

On Mon, Apr 15, 2013 at 5:22 PM, Joel Burton <joel@joelburton.com> wrote:

I have an existing app that uses wx2.9 and packages itself up with py2app
for a single clickable OSX app. It works fine.

I've been migrated my app to wx Phoenix (py3.3 is a new requirement) and
have an app that largely works fine under Phoenix/py3.3.

However, my py2app does not create a working application any longer.

--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Hi Joel,

I have an existing app that uses wx2.9 and packages itself up with py2app for a single clickable OSX app. It works fine.

I’ve been migrated my app to wx Phoenix (py3.3 is a new requirement) and have an app that largely works fine under Phoenix/py3.3.

However, my py2app does not create a working application any longer.

Examining the created app, it is not copying the libwx_osx_cocoau-2.9.5.0.0.dylib file into the created application package. With wx2.9, the libwx*dylib was copied into Content/Frameworks by py2app automatically and things worked. With wx Phoenix, it is not copied at all into the package.

Moving it into Content/Frameworks manually doesn’t work–it isn’t found by the application. Moving it manually to /Contents/Resources/lib/python3.3/lib-dynload/wx/libwx_osx_cocoau-2.9.5.0.0.dylib does work.

This isn’t a critical issue for me–I can easily move this file into the application via my build script. However, this is likely to be very confusing for people trying to make standalone apps. I’m uncertain how this stuff works, so I don’t have a good sense if this is a wxPython issue or a py2app issue. Is wx failing to say explicitly enough that the dylib is a dependency? Or did py2app manually and explicitly know to grab the dylib with pre-Phoenix wx?

Yes, I’m pretty sure py2app has some special magic for finding wx that no longer works with Phoenix. However, I think with the new Phoenix builds it is enough to specify package=[‘wx’] in the setup arguments to get it to include the entire wx bundle. You might want to give that a try.

Regards,

Kevin

···

On Apr 15, 2013, at 5:22 PM, Joel Burton wrote:

Thanks!

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Joel Burton wrote:

I have an existing app that uses wx2.9 and packages itself up with
py2app for a single clickable OSX app. It works fine.

I've been migrated my app to wx Phoenix (py3.3 is a new requirement) and
have an app that largely works fine under Phoenix/py3.3.

However, my py2app does not create a working application any longer.

Examining the created app, it is not copying the
libwx_osx_cocoau-2.9.5.0.0.dylib file into the created application
package. With wx2.9, the libwx*dylib was copied into Content/Frameworks
by py2app automatically and things worked. With wx Phoenix, it is not
copied at all into the package.

Moving it into Content/Frameworks manually doesn't work--it isn't found
by the application. Moving it manually to
/Contents/Resources/lib/python3.3/lib-dynload/wx/libwx_osx_cocoau-2.9.5.0.0.dylib
does work.

This isn't a critical issue for me--I can easily move this file into the
application via my build script. However, this is likely to be very
confusing for people trying to make standalone apps. I'm uncertain how
this stuff works, so I don't have a good sense if this is a wxPython
issue or a py2app issue. Is wx failing to say explicitly enough that the
dylib is a dependency? Or did py2app manually and explicitly know to
grab the dylib with pre-Phoenix wx?

It is probably due to how Phoenix tweaks the extension modules to use @loader_path in the dependency instead of a full path name to the .dylib, and py2app doesn't know how to deal with that. Phoenix is doing that so it can be totally self-contained and relocatable, in other words, without requiring that libraries be located at specific locations on the filesystem. For example, this will let a Phoenix egg be installed in the site-packages for any compatible Python, or even in virtualenv's site-packages, without needing post-processing or hacky links to install folders located elsewhere.

So in a nutshell, the wx .dlylib should now be considered part of the wx package, and either explicitly copied, copied as part of the whole package as Kevin suggests, or py2app should be taught how to deal with it.

···

--
Robin Dunn
Software Craftsman