The Gurobi Python Interface for Python Users
While the Gurobi installation includes everything you need to use
Gurobi from within Python, we understand that some users would prefer
to use Gurobi from within their own Python environment. Doing so
requires you to install the
gurobipy module. 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 setup.py), and issue the following command:
python setup.py 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 import gurobipy or from gurobipy import * from your Python shell and access all of the Gurobi classes and methods.
Note that Gurobi distributes an Anaconda package, so you don't need to perform these steps if you are using Anaconda Python. Please refer to the instructions for setting up Gurobi for use within the Anaconda distribution for details.
Note that for this installation to succeed, your Python environment
must be compatible with the Gurobi Python module.
You should only install Gurobi libraries into a 64-bit Python shell.
In addition, your Python version must be compatible. With this
gurobipy can be used with Python 2.7, 3.6, or 3.7 on