[Pythonmac-SIG] (re)newbie py2app question
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? Thanks for any help. -- Charles O. Hartman Poet in Residence Lucy Marsh Haskell '19 Professor of Literatures in English oak.conncoll.edu/cohar ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
[Pythonmac-SIG] Fix for international characters in Tcl/Tk 8.5
Good news for users of IDLE and other Tkinter-based applications! A fix for Cocoa Tcl/Tk 8.5 for improved handling of Mac OS X input methods was recently applied and has now been released in the latest ActiveState Tcl release (8.5.11.1) available here: http://www.activestate.com/activetcl/downloads It appears to fix a number of long standing problems with Cocoa Tcl/Tk 8.5 involving composite characters, like the French keyboard tilde (Option-N) problem and the inability to enter Option-U + vowel to form "umlauted" vowels on US keyboards. Entering these characters in IDLE, for instance, used to immediately crash Tcl and, hence, Python and IDLE. In fact, the Apple-supplied Tcl 8.5.9 in OS X 10.7 Lion exhibits this behavior (try it with /usr/bin/idle). (The Apple-supplied TCL 8.5 in OS X 10.6 Snow Leopard is so buggy as to be essentially unusable with IDLE.) Many thanks to Adrian Robert, Kevin Walzer, and the ActiveState team for addressing this nasty problem. If you install ActiveState Tcl 8.5.x, it will automatically be used by the python.org 2.7.x, 3.2.x, and 3.3.x 64-bit/32-bit Pythons for OS X 10.6 and 10.7. It will *not* be used by the Apple-supplied system Pythons nor by 32-bit-only python.org Pythons. More details here: http://www.python.org/download/mac/tcltk/ -- Ned Deily, [email protected] ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
Re: [Pythonmac-SIG] (re)newbie py2app question
In article , Charles Hartman 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, [email protected] ___ Pythonmac-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
Re: [Pythonmac-SIG] (re)newbie py2app question
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 wrote:
> In article
> ,
> Charles Hartman 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,
> [email protected]
>
> ___
> Pythonmac-SIG maillist - [email protected]
> 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
___
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
