Getting and setting up Anaconda and Gurobi

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.

Anaconda Platform This section guides you through the steps involved in installing Anaconda, a modern open source analytics platform powered by Python. Continuum Analytics is the creator and driving force of Anaconda. Anaconda includes over 330 Python and R packages such as an Integrated Development Environment (Spyder) and the leading web interactive notebook for data science (Jupyter). Anaconda significantly increases the interactivity and productivity of your Python model and application building experience.

If you don't already have a Gurobi license, please do one of the following:

  • Academic users: We offer a free license for qualified academics at recognized academic institutions. Visit our Free Academic License page for more information. If you haven't already done so, please register and login to access this page.
  • Commercial users: Please request a free evaluation license here.

Choose the version right for you:

Please choose the tab below corresponding to the platform that you wish to install Anaconda on, and then follow the instructions on that tab.

Gurobi and Anaconda for Windows


Step one: Download and install Anaconda

Gurobi supports Python 2.7 and 3.7 for Windows. Please choose the version of Anaconda you wish to download (the download will start automatically):

Once the download is complete, click on it to run the installer.


Step two: Install Gurobi into Anaconda

The next step is to install the Gurobi package into Anaconda. You do this by first adding the Gurobi channel into your Anaconda platform 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 three: 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 Jupyter Notebook.

Gurobi and Anaconda for Mac


Step one: Download and install Anaconda


Gurobi supports Python 2.7 and 3.7 for Mac. Choose the version of Anaconda you wish to download (the download will start automatically):

Once the download has completed, double click on the downloaded .pkg file and follow the installation instructions.

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.14 |Anaconda (64-bit)|
...

Type quit() in Python to return to the terminal.


Step two: Install Gurobi into Anaconda

The next step is to install the Gurobi package into Anaconda. You do this by first adding the Gurobi channel into your Anaconda platform 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 three: 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 Jupyter Notebook.

Gurobi and Anaconda for Linux


Step one: Download and install Anaconda

Gurobi supports Python 2.7, and 3.7 for 64-bit Linux. Choose the version of Anaconda you wish to download (the download will start automatically):

Once the download has completed, issue the following command in the directory where you stored the downloaded file:

bash Anaconda2-5.3.0-Linux-x86_64.sh

Note: If you are using Python 3.6, replace the above bash command with the following:

bash Anaconda3-5.3.0-Linux-x86_64.sh

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.14 |Anaconda (64-bit)|
...

Type quit() in Python to return to the terminal.


Step two: Install Gurobi into Anaconda

The next step is to install the Gurobi package into Anaconda. You do this by first adding the Gurobi channel into your Anaconda platform 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 three: 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 Jupyter Notebook.