The error message "Model too large for size-limited Gurobi license" or "Model too large for restricted Gurobi license" is displayed when Gurobi uses a restricted, size-limited license, and the model size exceeds these limits, i.e., 2000 variables, 2000 linear constraints, and 200 variables if quadratic terms are present.
This error typically occurs when Gurobi is installed using the pip or conda package distributors. These installations automatically include a size-limited license. This license also prints a message such as "Restricted license - for non-production use only".
If you already have a Gurobi license
Using a license file
If you already have a Gurobi license (academic or commercial), please be sure the license file is in the default location. The default directories where Gurobi will search for a gurobi.lic license file are:
Windows: | C:\gurobi, C:\gurobi1001 (for 10.0.1), and your home directory |
Linux: | /opt/gurobi, /opt/gurobi1001 (for 10.0.1), and your home directory |
macOS: | /Library/gurobi, /Library/gurobi1001 (for 10.0.1), and your home directory |
If you would like to store your license file in a non-default location, please follow the instructions here: Where do I place the Gurobi license file (gurobi.lic)?
Using parameters for license credentials
If you are using a client license for a floating site token server, Gurobi Instant Cloud, WLS (Web License Service), or a Compute Server/Cluster Manager, you may have chosen to pass the credentials via parameters to the Gurobi environment instead of using a gurobi.lic license file. This method is illustrated in the example mip1_remote.py. If this is the case, please check that you pass that environment as an argument when creating your model, such as:
with gp.Model(env=env) as model:
Please refer to How do I manage Gurobi environments in gurobipy?
If you would like to get a full Gurobi license
Please see Obtaining a Gurobi license for more information.
Comments
4 comments
Hi, I am trying to run an optimization problem and get this message while I do have an academic license installed. Could it be the case that I get such a message due to the number of cores that the script is trying to use (as I am using a very ''big'' computer with 12 cores)?
No, you would only encounter this error if Gurobi uses a size-limited license and the model size exceeds the limits of that license. This particular error is unrelated to the machine hardware.
I would confirm that your \(\texttt{gurobi.lic}\) file is located in a default location listed above. If you are still running into issues, feel free to ask for help in our Community Forum.
Thank you very much for the prompt response. Just to mention that -in case anyone else faces the same- because I am using Gurobi with anacondas, the license had to be in C:\anaconda3\ for it to be seen by the scripts.
This will only work if your anaconda installation is located at C:\anaconda3 because this is also where the gurobi_cl file is located. The better solution is to move the license file to your home directory or to C:\gurobi.
Please sign in to leave a comment.