First, set the following:


Then, choose below:

Quick Start Guides

Example Tour

Reference Manual

AMPL-Gurobi Guide

Remote Services

Cloud Guide

Building and running the examples

Building and running the examples

Python is an interpreted language, so no explicit compilation step is required to run the examples. For Mac platforms, you can simply type the following in the Gurobi Python example directory (<installdir>/examples/python):

If you are a Python user and wish to use Gurobi from within your own Python environment, we recommend that you use the Anaconda Python distribution. Anaconda includes a number of very useful packages, and the Gurobi Anaconda package simplifies the installation process.

You can also install the gurobipy module directly into other Python environments. The steps for doing this depend on your platform. On Mac OS, you will need to open a terminal window, change your current directory to the Gurobi <installdir> (the directory that contains the file, and issue the following command:

python install

Unless you are using your own private Python installation, you will need to run this command as super-user.

Once gurobipy is successfully installed, you can type python (more generally, you can type from gurobipy import * in your Python environment).