On Jan 23, 2005, at 5:35 AM, has wrote:


Having a problem with a semi-standalone app built using py2app 0.1.7. Building it OMM (OS10.2.8, MacPython 2.3.3) and the app works fine here, but on the user's machine (OS10.3, standard Apple-installed MacPython) it shows a dialog saying that it requires Python 2.3. What's wrong?

Nothing. The semi-standalone option depends on an equivalent Python installation and it didn't find one. An equivalent Python installation means that there is either one in the bundle, or on the filesystem in an identical location.

If you look at the Info.plist in a py2app application, is lists the equivalent Python installations:

<key>PyRuntimeLocations</key>
<array>
<string>@executable_path/../Frameworks/Python.framework/Versions/2.3/ Python</string>
<string>/System/Library/Frameworks/Python.framework/Versions/2.3/ Python</string>
</array>


When using --semi-standalone, your Python extensions can't have their Mach-O headers rewritten. If they are linked on a version of Python or platform that doesn't use -undefined dynamic_lookup, your application is susceptible to the Multiple Python Problem. I chose to display an error dialog and quit rather than run with no possibility to display an error message if something goes wrong.

You can override the contents of PyRuntimeLocations with the plist option, but the recommended solution to building a Python application that runs on multiple versions of OS X is to use a standalone bundle built on[1] the earliest supported version of Mac OS X.

In the future, py2app may audit your application to determine if it is safe to use "any" version of Python (no extensions, or extensions with only -undefined dynamic_lookup).. however, that still won't support your use case. In theory, it could use macholib to rewrite the headers at runtime into a temp dir if it determines that this is necessary, but I'm not going to implement that.

[1] I have successfully been able to build an OS X 10.2 compatible application on a later version of OS X, but all of the components that go into the bundle (extensions and Python) were compiled on OS X 10.2 and copied over.

-bob

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to