Search code examples
optimizationgurobi

GurobiError: No Gurobi license found


I'm attempting to run an example jupyter notebook from Gurobi: https://github.com/Gurobi/modeling-examples/blob/master/factory_planning/factory_planning_1.ipynb

I have installed gurobipy, but when I try to run the line factory = gp.Model('Factory Planning I') I receive an error message, GurobiError: No Gurobi license found.

I thought that gurobipy had a limited-variables option if you do not have a license, and that this option would at least allow me to run the example problems. Could you please help me learn how to run this example problem?

Unfortunately, Gurobi's support page was not helpful on this topic. https://support.gurobi.com/hc/en-us/articles/14971798307345-How-do-I-resolve-the-error-No-Gurobi-license-found

import numpy as np
import pandas as pd

import gurobipy as gp
from gurobipy import GRB

# tested with Python 3.7.0 & Gurobi 9.0

# Import data, snipped for brevity, see link above

factory = gp.Model('Factory Planning I')

And when starting the gp.Model, that is when I receive the error message.


Solution

  • If you use pip to install gurobipy, it comes with a free size-limited license. Most likely, you installed gurobipy from another source like the standard Gurobi distribution.