Re: [Pyobjc-dev] Detecting Python interpreters on startup
Brought to you by:
ronaldoussoren
From: Just v. R. <ju...@le...> - 2003-09-05 14:41:34
|
Dinu Gherman wrote: > The person uses Fink Python 2.3 on 10.2.6, so I think that if he > never touched his /usr/bin/python When he wrote """When I tried to run it on my Mac (10.2.6) by double-clickign the application, it started and then closed without any screen coming up""" I immediately thought: his /usr/bin/python is broken or gone. We'll never know for sure until we see what's in his Console.app. [ ... ] > The real question for me is: given multiple options for locations > and versions of installed Python interpreters on OS X, is there > any possibility to deploy an application that has the following > properties: > > 1. it finds and uses the one Python interpreter if there is > only one, > > 2. it can be told at launch time or via some kind of config > file before launch time which interpreter to use, > > 3. it makes its own "best choice" for 2. > > I think nobody wants to maintain different packages for people be- > longing to either Fink-, Apple-, Mac-Python and any other camps. > And for testing with different interpreters (even of the same camp) > this would also be very useful. It's moderately safe to make your app dependent on Jag's 2.2 (most things should work when running under Panther, but you can't know for sure. It's safe if Jaguar is all you need to support (unless someone breaks his sistem by messing with /usr/bin/python). Extension modules are not always compatible between Python versions. Due to sheer luck it appears that extension modules linked against a flat unix build also work when used with a framework build, but the other way round does not work. If you really want to use an installed version, you should just specify exactly which one. For end user apps, the best thing to do is INCLUDE the Python you're testing and building with with your app bundle. Luckily bundlebuilder makes this very easy. Use --standalone, with --strip to reduce the size of the bundle. Using Python 2.3 enables zipimport, making your .app smaller yet. I built a tiny standalone PyObjC app today, and compressed with StuffIt it's a 1 meg download. This includes a (stripped down version of) Python.framework. "python2.3 buildapp.py --standalone --strip build" was all there was to it. Just |