Installation
############

.. _windows_installer:

Windows Installer
*****************

Since version 1.2 of EINSTEIN there is a graphical installer for Windows 7,
Vista, XP and Windows 8. The installer handles all necessary dependencies and upgrades
of EINSTEIN.

Step 1:
  Download the latest EINSTEIN installer `EINSTEIN_N.N(plus)_windows.exe`,
    a bundle installer for MS-Windows 7, Vista and XP that contains not only
    EINSTEIN but the MySQL server, a Python environment and all dependencies
    in one installer.

Step 2:
  Execute the file you've downloaded and follow the instructions of the
  EINSTEIN installer.

  If the install is actually an update of an existing EINSTEIN installation
  then the database is saved as a backup into a file during the installation.
  By default the database is then updated to the new database schema keeping
  the existing projects in a consistent state.

  Alternatively you can export all your projects into XML files before you
  install the new EINSTEIN version, and then choose during the installation
  to replace the database with the new default database and import you
  projects into this one after the installation.

Step 3:
  Run EINSTEIN.

.. _source_archive:

Source Archive
**************

If you cannot use the :ref:`windows_installer`, you may want to install EINSTEIN
manually from a source archive: `EINSTEIN_N.N/N.N(plus)_linux.zip` (or `~_windows.zip`). 
In that case you have to take care of the dependencies of EINSTEIN yourself.

.. _dependencies:

Dependencies
============

Einstein uses the following software packages that have to be installed *PREVIOUSLY*
to the installation of EINSTEIN itself, if you decide to install EINSTEIN manually:

* Python (Version 2.6 or higher but not 3.x)
  Note: for EINSTEINplus, Version 2.7 is required

* MySQL (Version 5.1 or higher) - only needed for free version, not for EINSTEINplus

* several Python complements:

        wxPython:
                http://www.wxpython.org/
        numpy:
                http://numpy.scipy.org/
        matplotlib:
                http://matplotlib.sourceforge.net/
        MySQL-Python (free version only):
                http://sourceforge.net/project/showfiles.php?group_id=22307

.. _einsteinDB_manual:

Manual setup of EINSTEIN database
=================================

* Free version (using MySQL)

  EINSTEIN DB manual installation on MySQL:
    Create an empty database schema DATABASENAME and a user YOURUSER
    with all rights granted on the created database.
    Read the dump file einstein.sql into the database. E.g. by
    opening a DOS prompt and executing: ``mysql -uYOURUSER -pYOURPASS
    DATABASENAME < C:\\MyEINSTEIN\einstein\sql\einstein.sql`` where you
    have to substitute YOURUSER, YOURPASS, DATABASENAME and the path to
    EINSTEIN with the ones you have chosen before. **Warning** This
    direct read in of the dump only works for EINSTEIN Version 1.2 beta1
    and later as expected. The dump files of earlier versions ignore the
    database name and create always a database 'einstein' which deletes
    any former database of the same name.

  Configuration of MySQL password

    If you configured MySQL with a password, you have to specify this password in the EINSTEIN configuration:

    There are two possibilities

    #. edit manually the file :file:`einstein\\GUI\\einstein.ini` and put the password there. You will see that there is no password, originally.

    #. use the option :menuselection:`Database --> Database Administration` in EINSTEIN, and enter your password there.

  *NOTE:* you have to specify the folder where the executables of MySQL are located (typically something like :file:`C:\\Program Files\\MySQL\\MySQL Server 5.1\\bin`)


* EINSTEINplus:

  Copy the file einstein.db (either default database from C:\\MyEINSTEIN\einstein\sql, or your personal database
  from a previous EINSTEIN installation into the folder %appdata%\einstein\einsteinN.Nplus (where N.N indicates the version number)

.. _mac_os_x:

Notes on Mac OS X and Linux:
****************************

Download and extract the source version EINSTEIN_2.x.zip

Install Python 2.6 or later from http://www.python.org/download/releases/.
  Note: for EINSTEINplus, Version 2.7 is required

For Mac OS X Leopard more information is also available here:
http://wiki.python.org/moin/MacPython/Leopard

For the free EINSTEIN version (using MySQL) only:
  Also install MySQL 5.1 for Mac OS X from
  http://dev.mysql.com/downloads/mysql/5.1.html.

Then you should install all the necessary dependencies of EINSTEIN 
:ref:`(see above) <dependencies>`.

Finally you have to create a database for EINSTEIN analog to the option
:ref:`EINSTEIN DB manual installation <einsteinDB_manual>`.

After that you can  start einstein by changing into the
	src/einstein/GUI folder and execute ``python einsteinMain.py``