If you are using Python, you can install Gurobi Optimizer in two ways:
- Install Gurobi Optimizer directly:
- Download Gurobi from the website and install it.
- In your shell/terminal, go to Gurobi's installation folder (GUROBI_HOME) and run
python setup.py installNote: If you are using virtual environments, make sure to activate it before installing Gurobi.
- If you are using Anaconda Python, then you can install Gurobi through Gurobi's conda channel by running:
conda install -c gurobi gurobi
Both methods provide access to Gurobi (including gurobi_cl), but there are reasons why one may be preferable. So how do you choose which one to use?
When to use the direct installation
There are several reasons why you would use the direct installation through the website. Note that these are not mutually exclusive:
- You are using Gurobi in a language other than Python.
- You would like to have access to the Gurobi shell (gurobi.sh).
- You are not using (or do not want to use) Anaconda.
When to use the conda package
The conda package only works with Python, so you should only even consider using the conda installation if you are using Python.
- You are only using Gurobi in Python (and no other programming language) and are already using Anaconda/don't mind using it.
- You want to build a Docker image using Python and Gurobi. While it is not strictly necessary to use the conda package, it makes things a lot easier in the Dockerfile and the pipeline.
- You are using Windows and do not have administrator privileges.
- Gurobi with Anaconda: Windows, Linux, macOS
- Could not open PYTHONSTARTUP: Why does gurobi.sh or gurobi.bat not work for Anaconda installations?
- How do I update my Gurobi installation to a newer version?
- Which versions of Python can I use with Gurobi?