# Reuse gurobi license

**URL:** https://discourse.julialang.org/t/reuse-gurobi-license/46680
**Category:** Optimization (Mathematical)
**Tags:** question
**Created:** [September 16, 2020, 1:54am UTC](https://discourse.julialang.org/t/reuse-gurobi-license/46680 "2020-09-16T01:54:10Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Ken\_Lin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ken_lin/32/14367_2.png) [@Ken\_Lin](https://discourse.julialang.org/u/Ken_Lin)
#### Post date: [September 16, 2020, 1:54am UTC](https://discourse.julialang.org/t/reuse-gurobi-license/46680/1 "2020-09-16T01:54:10Z")

</div>

I would like my code to reuse a single gurobi license instead of one per model.

The following works for me:

```julia
const GRB_ENV = Gurobi.Env()
m1 = Model(solver=GurobiSolver(GRB_ENV))
m2 = Model(solver=GurobiSolver(GRB_ENV))
...

```

The question is how to do this if I’m using some functions from a package that also use gurobi? I cannot insert `GRB_ENV` in those functions without editing the package code.

---

<div class="post-metadata">

### Author: ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)
#### Post date: [September 16, 2020, 3:30am UTC](https://discourse.julialang.org/t/reuse-gurobi-license/46680/2 "2020-09-16T03:30:38Z")

</div>

Which package? That sounds like they need to provide this functionality.
