From: Kevin A. <al...@se...> - 2009-03-31 15:40:00
|
On Mar 31, 2009, at 5:49 AM, XXXXXXXXXXX wrote: > On Tue, 24 Mar 2009 08:27:49 +0000 XXXXXXXXXXX > XXXXXXXXXXXXXXXXXXXXXXXXXX wrote: > >> On Thu, 19 Mar 2009 16:21:31 +0000 XXXXXXXXXXX >> XXXXXXXXXXXXXXXXXXXXXXXXXX wrote: >> >>> On Wed, 18 Mar 2009 14:49:54 -0700 Kevin Altis >>> <al...@se...> wrote: >>>> >>>> I haven't decided whether to give Python 2.6.x a try yet. >>> >>> I've got an old G4 Mac mini still running Python 2.3.5 + wxPython >>> 2.5.x, which I can bring up to date. I'll try Python 2.6 on it in >>> the next few days if I get a chance. >> >> ...or at least that was the plan. Having installed 2.6, it still runs >> 2.3.5 when I run "python". And yet, on my old G3 where I installed >> 2.5 >> a while ago, the default when I run "python" is 2.5. So something's >> broken :-( > > Hmmm....maybe I should have documented what I did last time. Anyway, > there's an "Update Shell Profile.command" script in the "Python 2.6" > folder that gets created by the 2.6 installer in "Applications". Run > that script and it modifies .bash_profile or .profile so that running > "python" from a terminal session starts 2.6 instead of the default > 2.3.5 in Tiger. > > So...the good news is that I can now run "python minimal.py" in the > Pythoncard "samples" folder and it works :-) > > The bad news is that none of my Python scripts run by double-clicking > on them. The 2.6 version of "Python Launcher" briefly pops up and > disappears and....nothing :-( You should have a Python Launcher application in the MacPython 2.6 folder in Applications. When you double-click on a script this is what should get launched. If not, then you have to do a Get Info on a Python script; .py, .pyw, .pyc have to be done separately. I'm guessing the MacPython installer sets IDLE as the default application for scripts. If you double-click the Python Launcher application you can verify which Python it is going to use to open a given script. In my case, / usr/local/bin/python is used. It could be that in your case it is still set to /usr/bin/python or the location of an older default python. Here's some background that may help. I'm using 2.5.4, so the output below shows what you would see on your machine for various links. Below that is my info about ~/.MacOSX/environment.plist, the old magic file for scripts launched from the Finder. Unfortunately, I haven't looked at whether you still need the environment.plist stuff or not. It used to be that in order for launches from the Finder to be able to find the appropriate libraries, you needed one. It might still be relevant for me because I have my "working copy" of PythonCard and some other libraries set to be found by the PYTHONPATH defined in environment.plist. ka --- [yourmachine:~] yourusername% python Python 2.5.4 (r254:67917, Dec 23 2008, 14:57:27) [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> [yourmachine:~] yourusername% which python /Library/Frameworks/Python.framework/Versions/Current/bin/python [yourmachine:~] yourusername% ls -l /usr/local/bin/python lrwxr-xr-x 1 root wheel 68 Mar 18 14:42 /usr/local/bin/python - > ../../../Library/Frameworks/Python.framework/Versions/2.5/bin/python [yourmachine:~] yourusername% ls -l /Library/Frameworks/ Python.framework/Versions/Current/bin/python lrwxr-xr-x 1 root admin 9 Mar 18 14:42 /Library/Frameworks/ Python.framework/Versions/Current/bin/python -> python2.5 [yourmachine:~] yourusername% ls -lA .MacOSX/ total 8 -rw-r--r-- 1 yourusername staff 361 Sep 22 2003 environment.plist [yourmachine:~] yourusername% ls -la .MacOSX/environment.plist -rw-r--r-- 1 yourusername staff 361 Sep 22 2003 .MacOSX/ environment.plist [yourmachine:~] yourusername% cat .MacOSX/environment.plist <?xml version="1.0 encoding="UTF-8"?> <!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/ PropertyList.dtd"> <plist version="0.9"> <dict> <key>PATH</key> <string>/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/Users/ yourusername</string> <key>CVS_RSH</key> <string>ssh</string> <key>PYTHONPATH</key> <string>/Users/yourusername/python</string> </dict> </plist> |