[Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9

Michael Glassford glassfordm at hotmail.com
Wed Jul 12 20:28:47 CEST 2006


Bob Ippolito wrote:
> On Jul 12, 2006, at 7:51 AM, Michael Glassford wrote:
> 
>> 2) When I run python (either the one I built, from
>> /usr/local/bin/python2.4, or the one installed by the universal binary
>> installer at
>> /Library/Frameworks/Python.framework/Versions/2.4/python2.4), and
>> "import appscript", for example, I get this error:
>>
>>
>> """
>> Traceback (most recent call last):
>>    File "<stdin>", line 1, in ?
>>    File "/usr/local/lib/python2.4/site-packages/appscript/ 
>> __init__.py",
>> line 16, in ?
>>      from specifier import app, CommandError
>>    File "/usr/local/lib/python2.4/site-packages/appscript/ 
>> specifier.py",
>> line 9, in ?
>>      import aem
>>    File "/usr/local/lib/python2.4/site-packages/aem/__init__.py", line
>> 25, in ?
>>      from send import *
>>    File "/usr/local/lib/python2.4/site-packages/aem/send/__init__.py",
>> line 90, in ?
>>      raise RuntimeError, "Can't send Apple events: no access to Window
>> Manager. (aem-based scripts must be run within a GUI process; e.g. use
>> 'pythonw', not 'python', if running script in shell)"
>> RuntimeError: Can't send Apple events: no access to Window Manager.
>> (aem-based scripts must be run within a GUI process; e.g. use  
>> 'pythonw',
>> not 'python', if running script in shell)
>> """
>>
>> If I run /Library/Frameworks/Python.framework/Versions/2.4/ 
>> pythonw2.4, I
>> get the same error.
>>
>> What could make this not work properly?
> 
> First of all, the "pythonw2.4" path you list doesn't exist,

Sorry, instead of copying the path from the machine where it happened to 
the one that I'm emailing from, I typed it out and inadvertently left 
out the "/bin" that should have been at the end. It should have been 
"Library/Frameworks/Python.framework/Versions/2.4/bin/pythonw2.4".

> and  
> second it's not what you're running anyway! 
> Look at the site-packages  
> dir in the exception, that's a normal unix install, not a framework  
> install. 

Yes, as I said I ran three different executables and got the same error 
from each. This is only one of the three errors. Presumably the others 
would have had different site-packages paths. Unfortunately, the output 
is long gone and I can't reproduce this problem again except with 
/usr/local/bin/python2.4; however, I ran each more than once just to 
make sure, using the full path each time, so I don't see how I could 
have been mistaken. In any case...

 > You need a framework install (./configure --enable-framework
> && sudo make frameworkinstall).

Is there somewhere that I should have learned about this option?

When I did this, all of the unit tests passed. When I run 
/usr/local/bin/python2.4 I still get this error:

"""
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/appscript/__init__.py", 
line 16, in ?
     from specifier import app, CommandError
   File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/appscript/specifier.py", 
line 9, in ?
     import aem
   File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/aem/__init__.py", 
line 25, in ?
     from send import *
   File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/aem/send/__init__.py", 
line 90, in ?
     raise RuntimeError, "Can't send Apple events: no access to Window 
Manager. (aem-based scripts must be run within a GUI process; e.g. use 
'pythonw', not 'python', if running script in shell)"
RuntimeError: Can't send Apple events: no access to Window Manager. 
(aem-based scripts must be run within a GUI process; e.g. use 'pythonw', 
not 'python', if running script in shell)
"""

However, /usr/local/bin/pythonw2.4 appears to work OK now.

This behavior is different from the Python installed on Tiger by the 2.4 
universal binary installer (where there is no pythonw and python has 
access to the window manager), but at least I have something that seems 
to work now.

Thanks everybody for all of the help in this frustrating situation. If 
you have any suggested reading (online or otherwise) that would have 
helped me understand the workings of OSX, Python, etc. enough to figure 
out more of this myself, I'd be glad to hear of it.


Mike



More information about the Pythonmac-SIG mailing list