[Pythonmac-SIG] MachoPython 2.2.2 build question

Russell E Owen owen@astro.washington.edu
Thu, 7 Nov 2002 10:55:19 -0800


Damn, I thought I had it figured out, but now I'm really confused.

Somehow I got a partial framework build of 2.3a0 installed (probably 
when testing IDLE for somebody). My first attempt to build 2.2.2 
apparently ended up with the working python in /usr/local/bin that 
can launch aqua Tk but one cannot actually interact with the windows 
that are produced.

So I deleted /Library/Frameworks/Python.framework and tried again.

Since then I've tried to build Python 2.2.2 in two different ways, 
both of which have failed as far as a working framework goes.

- First try: unpack 2.2.2 and:
./configure --enable-framework
make
sudo make install

This results in a Library/Frameworks/Python.framework/Versions/2.2
which contains, among other things: bin/python
(Note that the contents of 2.2 are totally unlike those of 2.3, and 
that no Current directory was created.)

This runs if I do the following (though it kills my Terminal session 
when I exit Python):
cd /Library/Frameworks/Python.framework/Versions/2.2/bin/
exec python

However, I cannot get exec to run from any other directory. For example:
% exec /Library/Frameworks/Python.framework/Versions/2.2/bin/python
dyld: /Library/Frameworks/Python.framework/Versions/2.2/bin/python 
can't open library: Python.framework/Versions/2.2/Python  (No such 
file or directory, errno = 2)
Trace/BPT trap
(at which point my Terminal session exits, or my subshell if I start 
by issuing the "sh" command).

- Second try: unpack 2.2.2, modify setup.py to match that from 2.3a0, 
then repeat the process above. The result is identical.

Any suggestions? Can 2.2.2 be made to work with aqua Tk or should I 
give up and wait for 2.3 to be released?

(Also, this brings up some questions about plans for 2.3, but I'll 
put those in a separate message.)

-- Russell


>On Wednesday, November 6, 2002, at 10:03  AM, Russell E Owen wrote:
>>
>>Thank you very much. That pretty much did the trick.
>>
>>However, most of my files start with #!/usr/local/bin/python. Is 
>>there any way to get that to work? At present, running such files 
>>as commands leads to unusable windows, an ugly pitfall.
>
>Change your Tk scripts to use #!/usr/local/bin/pythonw or 
>#!/usr/bin/env pythonw
>
>>I tried the obvious (delete /usr/local/bin/python and rename 
>>/usr/local/bin/pythonw to it); typing python at the prompt does 
>>bring up a copy of python that can be used for Tkinter. However, 
>>any files that start with #!/usr/local/bin/python will *NOT* run 
>>(and it looks as if the #! line is totally failing to run).
>
>You want to leave /usr/local/bin/python alone so regular scripts can 
>run.  Make a symlink to python in /usr/local/bin
>
>ln -sf /Library/Frameworks/Python.framework/Versions/2.2/bin/python
>
>>While I'm on the subject of 2.2.2, should I be worried that 
>>test_sax and test_pyexpat are unexpectedly skipped after a "make 
>>test"? I fear this means that the xml stuff is broken, but am not 
>>certain. (I'm not using xml anyway, but do want to be sure that any 
>>unknown bugs are reported.)
>>
>>I'm thrilled to finally have aqua Tk support working (though still 
>>hope to get execution-as-a-command working again). I have posted 
>>instructions for building Python 2.2.2 with readlines and aqua 
>>Tkinter support on MacOS 10.2; see the link at: 
>><http://www.astro.washington.edu/owen>.
>>
>>-- Russell
>>
>>P.S. when Python is via exec... it claims to be Python 2.3a0 (#1, 
>>Sep 6 2002, 20:20:16), even though I built 2.2.2. I suspect this is 
>>a quirk of the 2.2.2 source code.
>
>Are you sure you don't have 2.3 installed?  Did you do ./configure 
>--enable-framework? I'm guessing you have pythonw using 2.3 and your 
>2.2.2 binary was in /usr/local/bin (the libs would be in 
>/usr/local/lib/python2.2)
>
>Take a peek in /Library/Frameworks/Python.framework/Versions