# Julia+Juno with Gurobi

**URL:** <https://discourse.julialang.org/t/julia-juno-with-gurobi/11131>\
**Category:** Tooling\
**Tags:** juliapro\
**Created:** [May 24, 2018, 3:57pm UTC](https://discourse.julialang.org/t/julia-juno-with-gurobi/11131 "2018-05-24T15:57:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![LINA\_MARCELA\_RAMIREZ](https://avatars.discourse-cdn.com/v4/letter/l/a3d4f5/32.png) [@LINA\_MARCELA\_RAMIREZ](https://discourse.julialang.org/u/LINA_MARCELA_RAMIREZ)\
**Post date:** [May 24, 2018, 3:57pm UTC](https://discourse.julialang.org/t/julia-juno-with-gurobi/11131/1 "2018-05-24T15:57:56Z")

</div>

I am using Julio Pro with Juno and I have a program to calculate economic dispatch with Gurobi Solver.  
I write Pkg.built(“Gurobi”) and Pkg.add(“Gurobi”) and the program do that.  
The program compile but don´t show the results of dispatch.

Help me please

---

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [May 24, 2018, 4:47pm UTC](https://discourse.julialang.org/t/julia-juno-with-gurobi/11131/2 "2018-05-24T16:47:27Z")

</div>

You’ll need to be a bit more specific to get a useful response.

When you say that it “don’t show the results of dispatch”, what do you mean? If everything is on default settings, you should see a Gurobi log printed to `stdout` while it’s running, but you’ll only see the solution if you display it somehow. Typically with JuMP you can get the solution by using `getvalue` on the variables.

---

<div class="post-metadata">

**Author:** ![LINA\_MARCELA\_RAMIREZ](https://avatars.discourse-cdn.com/v4/letter/l/a3d4f5/32.png) [@LINA\_MARCELA\_RAMIREZ](https://discourse.julialang.org/u/LINA_MARCELA_RAMIREZ)\
**Post date:** [May 24, 2018, 7:09pm UTC](https://discourse.julialang.org/t/julia-juno-with-gurobi/11131/3 "2018-05-24T19:09:08Z")

</div>

Thank you for your answer.  
I am using Gurobi, so mi model is  
ed=Model(solver=GurobiSolver(Presolve=0)) and now the error is:  
UndefVarError:Model no defined

Can you help me please?

---

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [May 24, 2018, 7:13pm UTC](https://discourse.julialang.org/t/julia-juno-with-gurobi/11131/4 "2018-05-24T19:13:41Z")

</div>

It sounds like you simply haven’t imported JuMP.

In Julia, the primary tool for formulating constrained optimization problems is called [JuMP.jl](https://github.com/JuliaOpt/JuMP.jl). It is able to provide problem formulation to many optimization back-ends including Gurobi. Typically if you are doing a constrained, convex optimization problem of the type Gurobi can handle, you’d start out by doing `using JuMP, Gurobi`. The JuMP documentation can be found [here](http://www.juliaopt.org/JuMP.jl/0.18/). Various examples can be found [here](https://github.com/JuliaOpt/JuMP.jl/tree/v0.18.1/examples).

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [September 12, 2023, 4:41pm UTC](https://discourse.julialang.org/t/julia-juno-with-gurobi/11131/5 "2023-09-12T16:41:38Z")

</div>


