You can install Gurobi Optimizer for Python in three different ways:
- Starting with Gurobi 9.1, you can use pip to install Gurobi into your currently active Python environment:
python -m pip install -i https://pypi.gurobi.com gurobipy
Pip is the standard way of installing Python packages and should work on most platforms and systems. We recommend this installation method for most Python users.
- If you are using Anaconda Python, you can install Gurobi through Gurobi's conda channel:
conda install -c gurobi gurobi
- Install the full Gurobi Optimizer package.
- Download the full Gurobi installation package from our website and install Gurobi.
- In your shell/terminal, navigate to the Gurobi installation folder (GUROBI_HOME) and run:
python setup.py install
Note: If you are using virtual environments, make sure to activate the virtual environment before installing Gurobi.
This table shows the features and differences between the installation methods:
|No Windows admin permissions required||✅||✅||❌|
|Can use APIs other than Python||❌||❌||✅|
|Easy setup for Docker||✅||✅||❌|
|Gurobi license tools (grbgetkey, grbprobe)||❌||✅||✅|
|Gurobi shell (gurobi.sh or gurobi.bat)||❌||❌||✅|
|Gurobi command line tools (gurobi_cl, grbcluster, grbtune, grb_ts)||❌||✅||✅|
- Gurobi with Anaconda: Windows, Linux, macOS
- How do I resolve the error "UnsatisfiableError" when using conda install?
- How do I resolve the error "Could not open PYTHONSTARTUP"?
- Which Python versions are supported by Gurobi?
- How do I update my Gurobi installation to a newer version?
- How do I use Gurobi with PyCharm?