Anaconda is a Python distribution platform that comes with a convenient package manager (“conda”), and a diverse set of curated software packages. Gurobi offers an installation package for this platform too. We will briefly explain the steps needed to install Anaconda and the Gurobi conda package. Note that the conda package installs more than just gurobipy. For example, it will also install the Gurobi command line tool gurobi_cl, some other tools, and documentation. For more information, please refer to How do I install Gurobi for Python?
If you have already installed Anaconda, you may skip directly to step 2 below.
Step 1: Download and install Anaconda
The first step is to download and install Anaconda. You can find detailed instructions on the Anaconda website. Be sure to check the box "Add Anaconda to my PATH environment variable" when prompted during the installation process. Otherwise, Step 2 may not work.
Gurobi supports the 64-bit x86 and ARM version and a variety of Python versions. Once the download has completed, issue the following command in the directory where you have stored the downloaded file:
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 3.8.4 |Anaconda, Inc.|...
Type quit() in Python to return to the terminal.
Step 2: Install the Gurobi conda package
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 a terminal window, issue the following command to add the Gurobi channel to your default search list:
conda config --add channels https://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
- How do I install Gurobi for Python?
- How do I resolve the error "UnsatisfiableError" when using conda install?
- How do I resolve the error "Could not open PYTHONSTARTUP"?
- How do I resolve common installation issues with the Gurobi Python Interface: gurobipy?
- Which Python versions are supported by Gurobi?