Installing the Anaconda Python distribution
The Gurobi distribution includes a Python interpreter and a basic set of Python modules. While these are sufficient for building and running simple optimization models, they provide just a glimpse of the wealth of tools and modules that are available for Python. This section guides you through the steps involved in installing Anaconda, a widely-used Python platform that includes an Integrated Development Environment (Spyder), a notebook-style interface (iPython Notebook), and a broad set of Python modules. These tools can significantly increase the interactivity and productivity of your Python model building experience.
Before we begin, we should note that Anaconda isn't your only choice in Python distributions and/or IDEs. Popular alternatives include Canopy, Eric, iep, and PyDev. We won't be covering the details of installing these other options for use with Gurobi, but the Anaconda instructions that follow should provide a good outline for the steps involved. We've found that Anaconda provides a nice balance between power and complexity, but we realize that people may look for different things in their Python environments.
Step 1: Download and Install Anaconda
The first step is to download and install Anaconda. You can find it here.
Gurobi supports both 64-bit Python 2.7 and 64-bit Python 3.5. Click
on the download button (
Linux 64-bit --- Python 2.7 in this
case) to begin the download. Once the download has completed, issue
the following command in the directory where you stored the downloaded
Once the install is complete, and once you close your current terminal
and open a new one, typing
python in your terminal window
should invoke the Anaconda Python interpreter:
> python Python 2.7.9 |Anaconda 2.2.0 (64-bit)| ...Type
quit()in Python to return to the terminal.
Step 2: Install Gurobi into Anaconda
The next step is to install the Gurobi package into Anaconda. You do
this by first adding the Gurobi channel to your Anaconda channels
and then installing the
gurobi package from this channel.
From an Anaconda terminal issue the following command to add the Gurobi channel to your default search list
conda config --add channels http://conda.anaconda.org/gurobi
Now issue the following command to install the Gurobi package
conda install gurobi
You can remove the Gurobi package at any time by issuing the command
conda remove gurobi
Step 3: Install a Gurobi license
The third step is to install a Gurobi license (if you haven't already done so).
You are now ready to use Gurobi from within Anaconda. Your next step is to launch either the Spyder IDE or iPython Notebook.