[Pythonmac-SIG] (re)newbie py2app question

Charles Hartman cohar at conncoll.edu
Mon Mar 5 04:28:33 CET 2012


Dear Ned (the ever-helpfu-and-clear; I've been following the listserv even
over the non-programming years),

Thanks.  FWIW, I'm not using Xcode at all.  I'm aware of the 32/64 change.
 I thought I had addressed it: my Python 2.7 runs in 64-bit mode
(sys.maxsize == 2 ** 64 yields True).  My wxPython ("classic," they call
it, for no clear reason; filename wxPython2.9-osx-2.9.3.1-cocoa-py2.7.dmg)
purports to be friendly to either 64-bit or 32-bit.  What other API would
be out of step?

Is the fact that the program runs without error inside the Wing IDE
debugger irrelevant?

Grateful but still bewildered,
Charles Hartman


On Sun, Mar 4, 2012 at 9:24 PM, Ned Deily <nad at acm.org> wrote:

> In article
> <CAJCj7-zT0iP9T7d53JOenjHaS4Gq9_39bRwEGL-wtMei84Ncgw at mail.gmail.com>,
>  Charles Hartman <cohar at conncoll.edu> wrote:
>
> > I'm just coming back to programming after years, trying to recompile an
> old
> > program that works but needs updating and expansion.  I'm now on OS
> 10.6.8,
> > Python 2.7.2, with wxPython (64/32bit).    My newly installed py2app
> > is: py2app-0.6.4-py2.7.egg.  All of these were in earlier versions when I
> > last packaged the program with py2app.
> >
> > In Console, the errors seem to be of two kinds.  There's a long list of
> > ScriptingAdditions messages about missing architectures.  Before that,
> > there's this:
> > [0x0-0x1bcfbce].org.pythonmac.unspecified.PyProse[87375] NameError:
> global
> > name 'self' is not defined
> >
> > That seems to be in a module of the program that certainly did work
> before.
> >  I can debug the program in WingIDE, I get no problems or errors (except
> > maybe the ScriptingAdditions ones) when I run it there.
> >
> > Have I forgotten something simple?  Has something changed that I missed?
>
> There are significant changes in OS X 10.6 compared to earlier versions.
> The major difference is that 64-bit Intel (aka -arch x86_64) is now the
> preferred build and execution architecture.   While 32-bit Intel and
> even 32-bit PPC execution (via Rosetta emulation) are still supported, a
> 64-bit/32-bit executable will, by default, run in 64-bit mode.
> Unfortunately, many older Carbon APIs are only available in 32-bit mode,
> as Apple cancelled earlier plans to make 64-bit versions of them.
> Chances are you are running into a problem with trying to use them.  You
> *may* be able to work around the problem by forcing your 64-bit/32-bit
> Python to run in 32-bit mode.  For the python.org 2.7.2, you should be
> able to do this by invoking Python as 'python2.7-32'.
>
> Another option might be to use the 32-bit-only python.org installer but
> be aware that there will be problems using this method on OS X 10.7 Lion.
>
> Also, life will likely be easier for you on 10.6 if you stick with Xcode
> 3.2.x (still available for download from the Apple Developer Connection)
> rather than the optional Xcode 4.x releases which are also the default
> on 10.7;  the latest versions of Xcode 4.x no longer supply the
> traditional gcc-4.2 that those Pythons were built with and expect to
> find to build C extension modules.  But, if you will eventually need to
> support 10.7, you should probably dig deeper into the errors and make
> your program work in 64-bit mode as well.
>
> Good luck!
>
> --
>  Ned Deily,
>  nad at acm.org
>
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG at python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig
> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
>



-- 

Charles O. Hartman
Poet in Residence
Lucy Marsh Haskell '19 Professor of Literatures in English
oak.conncoll.edu/cohar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20120304/fab94754/attachment-0001.html>


More information about the Pythonmac-SIG mailing list