coin-or / coin-or/python-mip

Setup gurobi cloud could not be loaded

Open
#221 1 comment 0 reactions 0 assignees View on GitHub
gurobi
Dominant language
Linear Programming
Stars
600
Forks
108
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
I'm trying to run with gurobi cloud and I have been following the linux install guide for it here: https://www.gurobi.com/documentation/9.1/quickstart_linux/software_installation_guid.html

I have run a hello world with gurobipy:
```

from gurobipy import *
model = Model("hello")
x = model.addVar(obj=3000, vtype="C", name="x")
y = model.addVar(obj=4000, vtype="C", name="y")
model.update()
L1 = LinExpr([5,6],[x,y])
model.addConstr(L1,">",10)
L2 = LinExpr([7,5],[x,y])
model.addConstr(L2,">",5)
model.ModelSense = 1 # minimize
model.optimize()
```
But when I run with python mip it does not work.
I have specified my license file and gurobi home correctly

```
from mip import Model, xsum, maximize, BINARY, GRB

p = [10, 13, 18, 31, 7, 15]
w = [11, 15, 20, 35, 10, 33]
c, I = 47, range(len(w))

m = Model("knapsack", solver_name=GRB)

x = [m.add_var(var_type=BINARY) for i in I]

m.objective = maximize(xsum(p[i] * x[i] for i in I))

m += xsum(w[i] * x[i] for i in I) <= c

m.optimize()

selected = [i for i in I if x[i].x >= 0.99]
print("selected items: {}".format(selected))
```
I get:
"Gurobi environment could not be loaded, check your license."

**Expected behavior**
I expect the gurobi cloud to work after specifing the license file

**Desktop (please complete the following information):**
- Linux ubuntu docker
- 3.6.8
- Python-MIP version: 1.13

I hope you can help be

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Model("knapsack", solver_name=GRB) entry point and reproduce the failure in the reported Ubuntu Docker and Python 3.6.8 environment. Compare Python-MIP's Gurobi environment setup with the direct gurobipy example and verify the configured license file and GUROBI_HOME; done means the cloud-backed model loads and the knapsack example optimizes without the environment error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, linux, python
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.