System requirements
-------------------

Leo requires Python 2.6 or above (including Python 3.x) and PyQt.

- Download Python from http://python.org/
    
- Download PyQt from http://www.riverbankcomputing.co.uk/news

Leo's HOME directory
--------------------

Python's HOME environment variable specifies Leo's HOME directory.
See http://docs.python.org/lib/os-procinfo.html for details.

Leo puts several files in your HOME/.leo directory:
.leoID.txt, .leoRecentFiles.txt, and myLeoSettings.leo.
There are various fallback directories if there is no home directory.

Installing the leo.py on Linux
------------------------------

Download the latest version of Leo (a .zip file) from `Leo's download page`_.

Unzip the downloaded .zip file into the **unpacked folder** in your home directory.
The unpacked folder will be called something like leo-4-5.

You can run Leo from your home directory.
You can add  ~/leo-4.10 to your path, or you can create an alias that executes::

    python ~/leo-4-10/launchLeo.py

Installing Leo on Windows
--------------------------

There are now two ways to install Leo on Windows:
    
1. Use the single-click executable installer, named something like
   LeoSetup-4.10-final.exe

2. Leo is distributed as a .zip file.
   To install Leo from the .zip file:

    1. Download the latest version of Leo (a .zip file) from:    
       http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

    2. Unzip the .zip file and place the unpacked leo folder in 
       the 'Program Files' folder or any convenient location.

    After you have installed Leo, you should add the location of your leo/core folder to your python path.
    One way to do this is adding something like the following to python/Lib/sitecustomize.py:

        import sys
        sys.path.append(r'<path-to-leo>leo\core')

    Another way is to append <path-to-leo> to the Windows PYTHONPATH environment variable.

Running Leo
-----------

You can run Leo from a Python interpreter as follows::

    import leo
    leo.run() # runs Leo, opening a new outline or,
    leo.run(fileName=aFileName) # runs Leo, opening the given file name.

Another way to run Leo is as follows::

    cd <path-to-launchLeo.py>
    python launchLeo.py

Here are some tips that may make running Leo easier:

**Linux**
    The following shell script will allow you to open foo.leo files by typing leo foo::

        #!/bin/sh 
        python <leopath>launchLeo.py $1

    where <leopath> is the path to the directory *containing* the leo directory. 

**Windows**
    You can associate Leo with .leo files using a batch file. Put the
    following .bat file in c:\\Windows::

        <path-to-python>/python <path-to-leo>/launchLeo.py %*

    Here <path-to-leo> is the path to the directory *containing* the leo directory,
    that is, the directory containing launchLeo.py.

The first time you start Leo, a dialog will ask you for a unique identifier. If
you are using cvs, use your cvs login name. Otherwise your initials will do. Leo
stores this identifier in the file ``.leoID.txt``. Leo attempts to create
``leoID.txt`` in the .leo sub-directory of your home directory, then in Leo's config directory, and
finally in Leo's core directory. You can change this identifier at any time by
editing ``.leoID.txt``.