Python Interface

Gurobi comes with a Python extension module called “gurobipy” that offers convenient object-oriented modeling constructs and an API to all Gurobi features. The Gurobi distribution also includes a Python interpreter and a basic set of Python modules (see the interactive shell), which are sufficient to build and run simple optimization models. You can also install gurobipy into an existing Python installation or virtual environment (https://docs.python.org/3/library/venv.html).

In this section, we will first review installation options. We then point out some useful Python tools and their installation. Finally, we introduce you to the basic usage of gurobipy by means of a few concrete examples.



Subsections

Try Gurobi for Free

Choose the evaluation license that fits you best, and start working with our Expert Team for technical guidance and support.

Evaluation License
Get a free, full-featured license of the Gurobi Optimizer to experience the performance, support, benchmarking and tuning services we provide as part of our product offering.
Academic License
Gurobi supports the teaching and use of optimization within academic institutions. We offer free, full-featured copies of Gurobi for use in class, and for research.
Cloud Trial

Request free trial hours, so you can see how quickly and easily a model can be solved on the cloud.

Search