MacOS X 10.2 comes with a built-in python interpreter, but unfortunately the built in interpreter has no support for Tkinter (the library Leo uses to display its graphics), so if you try to run Leo using the built-in python you will get an error message saying that Tkinter cannot be imported.
This document describes the steps you must take to get Leo to run under MacOS X.
There are two ways of running Leo under Mac OS X. Leo can either be run natively in its own Aqua window or it can be run under an X11 server. Native running is usually more elegant, since it gives Leo the standard Mac OS look and feel. Running it under X11 might be a good option if you aldready use a lot of X11 programs. This document only describes the installation procedure for Aqua.
Install the TclTkAqua package.
Download and install the file TclTkAqua-8.4.1-Jaguar.dmg from http://sourceforge.net/project/showfiles.php?group_id=10894&release_id=117868.
Note that you probably do not want to install the 8.4.2 version. The TclTk project uses odd numbers for stable versions and even numbers for unstable development releases.
There is also a BI version of TclTkAqua. BI stands for Batteries Included. This distrubiton includes many of the commonly used extensions to Tk, in addition to Tk itself. It is not needed for running Leo.
Install the Python interpreter
A python interpreter compiled to run with AquaTk is available at https://sourceforge.net/project/showfiles.php?group_id=10718. Download the file:
MacPython-OSX-2.3a2-2.dmg?download
or any newer version of the interpreter and install it.
At least some versions of this installer has a bug that appears when you try to install it on a system with a single disk. The installer will erroneously report that the program cannot be installed on the disk. To fix the problem just Go Back and press Continue again. You will then be able to continue the installation.
Download and install the source code version of Leo from Leo's project page.
Rename the leo.py file to leo.pyw.
This tells MacPython that leo.pyw is a GUI script that should run in its own GUI window.
You should now be able to run Leo by double clicking on the leo.pyw file. You can create an alias of the file in some convenient location to have easy access to the program.
To run Leo from the command line, type:
/usr/local/bin/pythonw leo.pyw
This should start Leo. (pythonw is a small wrapper script that is needed to work around a bug in AquaTk which prevents windows from being brought to front).
To get .leo documents to open with Leo, you must first create an AppleScript that can launch Leo. Start up the script editor and enter the following text:
on open filelist
repeat with i in filelist
do shell script "/usr/local/bin/pythonw /Src/Leo/leo.pyw " & POSIX path of i & " > /dev/null 2>&1 &"
end repeat
end open
on run
do shell script "/usr/local/bin/pythonw /Src/Leo/leo.pyw > /dev/null 2>&1 &"
end run
You should replace /Src/Leo/leo.pyw with the path to wherever you have installed Leo.
Save this script as Application at some suitable location. Name it "Leo" or something similar. You can now launch Leo by double-clicking the script icon. You can also open Leo files by dropping them on the script icon.
Double click any .leo file. In the dialog box that appears select Choose Application... and choose the script application you just created.