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 the message "Restricted license - for non-production use only" when running a Python program using Gurobi.
The only other license that has this restriction is the "Gurobi for Online Courses" license, which appears as TYPE="Free Trial" in the Licenses view of your User Portal.
If you receive this error and you are not using a "Free Trial" license but an academic or commercial/evaluation license, then Gurobi is not using the correct license. Please continue reading the sections below to learn how to get Gurobi to use the correct license.
If you already have a full 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:\gurobi1100 (for 11.0.0), and your home directory|
|Linux:||/opt/gurobi, /opt/gurobi1100 (for 11.0.0), and your home directory|
|macOS:||/Library/gurobi, /Library/gurobi1100 (for 11.0.0), 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:
# Formulate problem
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.