You can install Gurobi Optimizer for Python in three different ways:
Using pip
Starting with Gurobi 9.1, you can use pip to install Gurobi into your currently active Python environment:
python -m pip install gurobipy
Pip is the standard way of installing Python packages and should work on most platforms and systems. Use this command to install a specific version:
python -m pip install gurobipy==10.0.1
Note: The pip installation method does not provide Gurobi license tools. If you have not yet set up a license on your machine then you will need to use one of the other installation methods or install the license tools package.
Using conda
If you are using Anaconda Python, you can install Gurobi through Gurobi's conda channel:
conda install -c gurobi gurobi
Use this command to install a specific version:
conda install -c gurobi gurobi=10.0.1
Note: Gurobi is not available via conda for all Python versions (full list).
Using setup.py
Install the full Gurobi Optimizer package.
- Download and install the full Gurobi installation package from our website.
- 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.
Differences between the installation methods
pip | conda | full installer | |
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) | ❌ | ✅ | ✅ |
Offline installation | ❌ | ❌ | ✅ |
Further information
- Installing Gurobi Optimizer
- Using pip to install the Gurobi for Python interface (gurobiy)
- Using conda to Install the Gurobi for Python Interface in Anaconda
- Which Python versions are supported by Gurobi?
- How do I resolve common installation issues with the Gurobi Python Interface: gurobipy?
- How can I set up a license without installing the full Gurobi package?
- How do I update my Gurobi installation to a newer version?
- How do I use Gurobi with PyCharm?
Comments
0 comments
Please sign in to leave a comment.