Rich Holmes wrote:I see nothing in GollyPrefs about Python version, but sys.version does indeed say 2.6.x...
Just to clarify, the Mac version of Golly is linked against Python 2.6 so we can distribute a single build that runs on all Macs from 10.6 up. (Although given that very few people are still using 10.6, and that it's possible to install Python 2.7 on 10.6, I think in future I'll just link against Python 2.7.)
The reason there's no mention of a Python version in GollyPrefs is that on the Mac the Python lib is loaded dynamically at start-up time (using a framework path stored in the binary). On Windows and Linux the Python libs are loaded the first time a .py script is executed. On those platforms the python_lib path in GollyPrefs tells Golly which file to load (a .dll file on Windows, a .so file on Linux).
As Dave mentioned above, the solution to Rich's problem is to use the install_name_tool command to change the framework path so that Python 2.7 will be loaded at start-up. I've set up a couple of aliases called newpy and oldpy so I can easily toggle between 2.7 and 2.6:
Code: Select all
[akt-iMac:~] akt% alias
...
newpy install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.6/Python /Library/Frameworks/Python.framework/Versions/2.7/Python /HD/Golly/golly/Golly.app/Contents/MacOS/Golly
oldpy install_name_tool -change /Library/Frameworks/Python.framework/Versions/2.7/Python /System/Library/Frameworks/Python.framework/Versions/2.6/Python /HD/Golly/golly/Golly.app/Contents/MacOS/Golly