Skip to main content

Not Recognizing Gurobi License

Answered

Comments

2 comments

  • Ryuta Tamura
    • Gurobi Staff

    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
  • Igor Ganapolsky

    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.