# Problems trying to run JuMP and GLPK

**URL:** <https://discourse.julialang.org/t/problems-trying-to-run-jump-and-glpk/46175>\
**Category:** Optimization (Mathematical)\
**Tags:** package, jump\
**Created:** [September 7, 2020, 6:04am UTC](https://discourse.julialang.org/t/problems-trying-to-run-jump-and-glpk/46175 "2020-09-07T06:04:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [September 7, 2020, 6:04am UTC](https://discourse.julialang.org/t/problems-trying-to-run-jump-and-glpk/46175/1 "2020-09-07T06:04:17Z")

</div>

When I try to run JuMP packets, GLPK with the command  
using JuMP, GLPK  
I get the following alert:

```julia
m = Model(GLPK.Optimizer)
ERROR: MethodError: no method matching Model(::Type{GLPK.Optimizer})
Closest candidates are:
  Model(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) at C:\Users\hermesr\.julia\packages\JuMP\iGamg\src\JuMP.jl:126
  Model(; caching_mode, solver) at C:\Users\hermesr\.julia\packages\JuMP\iGamg\src\JuMP.jl:161
  Model(::MathOptInterface.AbstractOptimizer, ::Dict{MathOptInterface.ConstraintIndex,AbstractShape}, ::Set{Any}, ::Any, ::Any, ::Dict{Symbol,Any}, ::Int64, ::Dict{Symbol,Any}) at C:\Users\hermesr\.julia\packages\JuMP\iGamg\src\JuMP.jl:126
  ...
Stacktrace:
 [1] top-level scope at REPL[11]:1
 [2] include_string(::Function, ::Module, ::String, ::String) at .\loading.jl:1088

#
(@ v1.5)pkg> st -m JuMP
   [4076af6c] JuMP v0.21.3
(@ v1.5) pkg> st -m GLPK
   [60bf3e95] GLPK v0.13.0

```

---

<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 7, 2020, 9:41pm UTC](https://discourse.julialang.org/t/problems-trying-to-run-jump-and-glpk/46175/2 "2020-09-07T21:41:23Z")

</div>

Quit Julia and open a new instance of the REPL to load the latest versions.

It looks like you have the old version of JuMP in memory, so I guess you updated in this session?

---

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [September 8, 2020, 7:56am UTC](https://discourse.julialang.org/t/problems-trying-to-run-jump-and-glpk/46175/3 "2020-09-08T07:56:25Z")

</div>

> [@odow](#):
>
> Quit Julia and open a new instance of the REPL to load the latest versions.

Now the following alert is presented:

```julia
Julia>@constraints(m, begin
          3x + 5y + 2z == 12,
              2x + 5y - 4z == 9,
                  4x - y + 5z == -3
                  end)
ERROR: In `@constraint(m, 3x + 5y + 2z == 12, (2x + 5y) - 4z == 9, (4x - y) + 5z == -3)`: Too many arguments.
Stacktrace:
 [1] error(::String, ::String) at .\error.jl:42
 [2] _macro_error(::Symbol, ::Array{Any,1}, ::String) at C:\Users\hermesr\.julia\packages\JuMP\YXK4e\src\macros.jl:894
 [3] (::JuMP.var"#_error#68"{Symbol})(::String) at C:\Users\hermesr\.julia\packages\JuMP\YXK4e\src\macros.jl:366
 [4] _constraint_macro(::Tuple{Symbol,Expr,Expr,Expr}, ::Symbol, ::typeof(parse_constraint_expr)) at C:\Users\hermesr\.julia\packages\JuMP\YXK4e\src\macros.jl:385
 [5] @constraint(::LineNumberNode, ::Module, ::Vararg{Any,N} where N) at C:\Users\hermesr\.julia\packages\JuMP\YXK4e\src\macros.jl:490 [6] include_string(::Function, ::Module, ::String, ::String) at .\loading.jl:1088

```

---

<div class="post-metadata">

**Author:** ![tomerarnon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomerarnon/32/3170_2.png) [@tomerarnon](https://discourse.julialang.org/u/tomerarnon)\
**Post date:** [September 8, 2020, 8:03am UTC](https://discourse.julialang.org/t/problems-trying-to-run-jump-and-glpk/46175/4 "2020-09-08T08:03:51Z")

</div>

```julia
@constraints(m, begin
    3x + 5y + 2z == 12
    2x + 5y - 4z == 9
    4x - y + 5z == -3
end)

```

no commas after the expressions.

---

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [September 8, 2020, 8:08am UTC](https://discourse.julialang.org/t/problems-trying-to-run-jump-and-glpk/46175/5 "2020-09-08T08:08:53Z")

</div>

OK; 👍🏻

```julia
@constraints(m, begin
          3x + 5y + 2z == 12
          2x + 5y - 4z == 9
            4x - y + 5z == -3
                  end)

Julia>optimize!(m)

Julia>value.((x,y,z))
11:07:17->>(-0.8918918918918918, 2.675675675675676, 0.6486486486486487)

```
