# JuMP problem with all\_variables

**URL:** <https://discourse.julialang.org/t/jump-problem-with-all-variables/24006>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [May 8, 2019, 6:46pm UTC](https://discourse.julialang.org/t/jump-problem-with-all-variables/24006 "2019-05-08T18:46:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gbustosx](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@gbustosx](https://discourse.julialang.org/u/gbustosx)\
**Post date:** [May 8, 2019, 6:46pm UTC](https://discourse.julialang.org/t/jump-problem-with-all-variables/24006/1 "2019-05-08T18:46:19Z")

</div>

Hi, I am trying to use all\_variables but I get the following error message:

UndefVarError: all\_variables not defined

Stacktrace:  
[1] getproperty(::Module, ::Symbol) at ./sysimg.jl:13  
[2] top-level scope at In[83]:1

The JuMP version I am using is JuMP v0.19.0+ #7c115a2 ([https://github.com/JuliaOpt/JuMP.jl.git](https://github.com/JuliaOpt/JuMP.jl.git))

Thank you!

---

<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:** [May 8, 2019, 6:51pm UTC](https://discourse.julialang.org/t/jump-problem-with-all-variables/24006/2 "2019-05-08T18:51:33Z")

</div>

It looks like you might be on an (old) beta-release of JuMP. Run

```nohighlight
] rm JuMP
] add JuMP

```

Once you’ve done that, the following should work.

```nohighlight
using JuMP
model = Model()
@variable(model, x)

all_variables(model)

# output

1-element Array{VariableRef,1}:
 x

```

In future, please read [Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757).

---

<div class="post-metadata">

**Author:** ![gbustosx](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@gbustosx](https://discourse.julialang.org/u/gbustosx)\
**Post date:** [May 8, 2019, 7:42pm UTC](https://discourse.julialang.org/t/jump-problem-with-all-variables/24006/3 "2019-05-08T19:42:28Z")

</div>

Thank you, Oscar, it worked, and also thank you for the link to improve questions
