(Draft, do not use!)

The Challenge with Python Versions

If you are only interested in installing Python for the Software Tools for OR Course, you can skip this section. If you intend to do some development in Python after the course, it is worth reading the below.

There are a number of Python versions and distinct implementations of each version out there. As an OR practitioner, you'd ideally like to not care too much about which versions are backwards compatible to which, which versions run what packages, and any implementation specific quirks, but, sadly, you do need to know a tiny bit of this. This short section outlines the stuff you should know about python versions.

Python releases are numbered as either 2.x or 3.x. (At the time of writing, current production versions are listed as 2.7.3 and 3.3.0.) Unfortunately, code written for Python3.x is often not backwards compatible with 2.x. As a result, it is not uncommon for developers to have two separate installations of Python, one for 2.x and one for 3.x.

In addition, there are dozens of implementations of each version. (See http://www.python.org/download/ if you're curious.)

If you are a Windows or Linux user...

It doesn't really matter which implementation you download, as long as it is the right version number. You can download separately any (compatible) packages you want but don't have in your particular implementation and everything should run smoothly.

Our recommendation below is that you install the EPD version of Python 2.7, 32-bit. This is a stable-version of Python that ships with lots and lots of packages already installed, including most numerical and scientific packages you'd ever want to use as a researcher. See http://www.enthought.com/products/epd.php for details. The total installation is a little large (because it has so many packages).

If you're really space conscious, and know what you're doing, you can install a bare-bones implementation of Python 2.7, and manually add the packages you need. (See below). This is not the recommended way.

If you are a Mac OSX user who wants to use Gurobi...

Life is a bit harder. Mac OSX ships with a couple different python implementations (let's call them Apple's implementations). These are primarily used by the OS for various system tasks. They tend to be out-of-date (last updated when you updated your OS), and a little quirky. Conventional wisdom is to avoid using them and to install a separate newer version of Python.

Unfortunately, for unknown reasons, the Python-Gurobi interface ONLY works for Apple installation Python 2.6. (Gurobi Documentation Explaining ) Since Gurobi is pretty-critical tool, and Apple's version of Python2.6 is out-of-date, this is a huge headache.

Our recommendation below is that you install Gurobi (to Apple Implementation Python2.6) and install the packages for PuLP for this version for the session "Modelling Linear Optimization with PuLP." In addition, you should install EPD Python2.7, 32-bit. This is a stable-version of Python that ships with lots and lots of packages already installed, including most numerical and scientific packages you'd ever want to use as a researcher. See http://www.enthought.com/products/epd.php for details. The total installation is a little large (because it has so many packages). You will use this version of Python2.7 for the session "Convex Optimization with CVX and CVXOPT."

If you're really space conscious, and know what you're doing, you can install a bare-bones implementation of Python 2.7, and manually add the packages you need for the Convex Optimization Tutorial. (See below). This approach has not been tested and is not recommended.

Going forwards in your research, you likely will use the EPD version of Python2.7 (in conjunction with CPLEX) for all of its wonderful pre-installed packages and simplicity of use. If you have a need to use Gurobi, you will use your Apple Installation of Python2.6.

____

Installing Python for Windows and Linux users

Installing EPD Python 2.7
  1. Go to http://www.enthought.com/products/epd_free.php
  2. Download the installer for your operating system.
    1. Get the 32-bit version unless you know what you are doing.
  3. Run installer, follow instructions - the default options are fine.
    1. Take note of where you are installing the application. You will need it later.
    2. It will probably install to C:/Python27
Installing some other Python implementation

If you strongly prefer a smaller installation than above, you can follow the steps below. These are not recommended.

  1. Go to http://python.org/download/
  2. Download "Python 2.7.3 Windows Installer"
    1. Get the 32-bit version unless you know what you are doing.
  3. Run installer, follow instructions - the default options are fine.
    1. It will probably install to C:/Python27

You next need to install setuptools. This small application helps you install Python packages.

If you are on Linux, you may already have it, if not, install with your package manager. You need version >= setuptools-0.6c11.

If you are on Windows,

  1. Go to http://pypi.python.org/pypi/setuptools#files
  2. Download setuptools-0.6c11.win32-py2.7.exe
  3. Install it - default options should be fine.

____

Installing Python for Mac OSX Users

Installing EPD Python 2.7

http://www.enthought.com/products/epd_free.php]

  • No labels