Not Recognizing Gurobi License
AnsweredWindows 11 - I saved my Gurobi license on to the default location c:/users/username. When I open cmd prompt and type “get key”, I get the following error:
'grbgetkey' is not recognized as an internal or external command,
operable program or batch file.
I previously had the file in lisence saved at the C:/ location, and when I used that location and opened the cmd prompt, the command “grbgetkey” did work, but the license key number did not work.
-
Hi Christina,
>I saved my Gurobi license on to the default location c:/users/username.
If you already have your license file and saved on appropriate location, you don't need to run grbgetkey. The grbgetkey is just a tool for generating licenses.
If you need to run `grbgetkey`, please refer to this article:
How do I resolve the error "grbgetkey: command not found" or "'grbgetkey' is not recognized"?0 -
Adding to Ryuta's answer: grbgetkey only exists if you installed the full Gurobi Optimizer distribution and its bin directory is on your PATH. If you installed with "pip install gurobipy", there is no grbgetkey on the machine at all - that is expected, not a broken install. Two quick checks on Windows 11: (1) run "python -c \"import gurobipy; print(gurobipy.gurobi.version())\"" to confirm the module loads; (2) if you have a license file, make sure it is named exactly gurobi.lic (not gurobi.lic.txt - Windows hides known extensions) and sits in C:\Users\<yourname>\, or set the env var GRB_LICENSE_FILE to its full path and open a fresh cmd window so the variable is picked up. Note that pip gurobipy ships with a limited-size trial license built in, so for small models you do not need any license file - if your model is bigger than the size limit you will see a "Model too large for size-limited license" error rather than a license-not-found error, which is a useful way to tell the two problems apart.
0
Please sign in to leave a comment.
Comments
2 comments