
[[Prerequisites]]
== Prerequisites ==

=== Python 2.6 or 2.7 ===

Coopr requires Python version 2.6 or 2.7. In particular, some
components rely on Python modules that exhibited known bugs in
Python 2.4. Further, we rely on and benefit from several packages
and performance improvements introduced in Python 2.6. The Python
language underwent some rather large changes to version 3.0. These
changes are not backward-compatible with Python 2.x, and consequently
Coopr does not currently not work with Python 3.0.

* Windows users:
+

The link:http://python.org/download[Python web site] provides binary
installation downloads for Windows and Mac.  Recall that the PATH
environment variable may need to be updated, as the installers
typically do not update it automatically.  On Windows, this can be
easily accomplished via the Control Panel "Advanced System Settings"
panel.

* Linux/UNIX users:
+
Most flavors of Unix ship with Python, and a compatible version of
Python is typically and easily installed using your distribution's
package manager.  Note that you will need to install both the
`python` package and (if separate) the `python-devel` package (to
get the Python header files that are needed to compile some external
applications distributed with Coopr).  Most Linux installers put
the Python executable on a common location on your path.  If this
is not the case for your particular distribution, you can add the
location to your shell's PATH environment variable.

* Mac users:
+
The link:http://python.org/download[Python web site] provides binary
installation downloads for Mac.  Recall that the PATH environment
variable may need to be updated, as the installers typically do not
update it automatically.

Please be aware of 32-bit versus 64-bit issues, particularly if you
are running Windows. In particular, if running a 64-bit Windows OS
(likely at this point, but not so with XP or earlier versions), you
should use the Python 2.X.Y Windows X86-64 installer, as opposed
to the (32-bit) Python 2.X.Y Windows installer. If you run 32-bit
Python on a 64-bit Windows platform, for example, you won't have
access to any more than 3GB (actually a bit less) of RAM - even
though the machine probably has 8GB or more.

Note that several Python distributions are available that are bundled
with convenient packages (e.g. link:http://www.scipy.org/[SciPy]
and link:http://matplotlib.sourceforge.net/[MatPlotLib]):

* link:http://www.pythonxy.com/[Python(x,y)]
* link:http://www.activestate.com/activepython[ActiveState]
* link:http://www.enthought.com/products/epd.php[Enthought]


=== Subversion ===

It may be necessary to install to have subversion installed on your
system to execute the `coopr_install` installation script. On Unix
systems, this is commonly pre-installed.  On Windows, free installer
packages can be obtained from
link:http://www.collab.net/downloads/subversion/[CollabNet].

Only the command-line client is necessary; specifically, the
"CollabNet Subversion Command Line" distribution should be used.
Do ''not'' install "CollabNet Subversion Edge", as it downloads and
installs Python 2.5. While the CollabNet download is free, CollabNet
will require you to create a login - presumably to track usage
statistics. The installer updates the system PATH variable
automatically.


=== Pywin32 ===

On Windows, it may also be necessary to install the Python Windows
extensions. This package enables Python to support Windows COM
interfaces, and specifically it allows Pyomo to work with Excel
spreadsheets. Note that "pywin32" is a bit of a misnomer, in that
it works fine on 64-bit platforms; based on what we can tell, the
"32" just means "non-16-bit".

The installer for this extension is available from
http://sourceforge.net/projects/pywin32.  This install simply updates
the python site packages.


=== PyODBC ===

Coopr requires the installation of PyODBC to access ODBC data
sources.  On Windows, the PyODBC package can be installed by
downloading a Windows installer, or by executing `easy_install`:
[[shell]]
----
easy_install pyodbc
----
On Unix-based systems, (including Linux and Mac OS X) will require several system-level packages for proper ODBC functionality. These include:

* `unixODBC`: provides generic ODBC connectivity
* `unixODBC-devel`: includes ODBC development headers for linking with other libraries
* `mdbtools`: implements Microsoft Jet (Access) database interaction
* `libmdbodbc`: bridges Jet databases via ODBC

Finally, users on such Unix-based systems may have to configure their local ODBC installations for Jet databases if using Microsoft Access. To do so, add the following to the file `/etc/odbcinst.ini`:

----
[Microsoft Access Driver (*.mdb)]
Description = MDB Tools ODBC drivers
Driver      = /usr/lib/libmdbodbc.so.0
Setup       =
FileUsage   = 2
----
Pyomo will attempt to add any further ODBC information as needed.


// vim: set syntax=asciidoc:
