# MLJ- Unpack not defined

**URL:** <https://discourse.julialang.org/t/mlj-unpack-not-defined/34577>\
**Category:** General Usage\
**Tags:** package, mlj\
**Created:** [February 13, 2020, 2:38pm UTC](https://discourse.julialang.org/t/mlj-unpack-not-defined/34577 "2020-02-13T14:38:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phillip\_Sutton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/phillip_sutton/32/7603_2.png) [@Phillip\_Sutton](https://discourse.julialang.org/u/Phillip_Sutton)\
**Post date:** [February 13, 2020, 2:38pm UTC](https://discourse.julialang.org/t/mlj-unpack-not-defined/34577/1 "2020-02-13T14:38:22Z")

</div>

Getting an error when attempting to unpack the Boston RDataset

```julia
y, X = MLJBase.unpack(boston, ==(Symbol(outcome_name)), colname -> true)
UndefVarError: unpack not defined

Stacktrace:
 [1] getproperty(::Module, ::Symbol) at .\Base.jl:13
 [2] top-level scope at In[6]:1

```

When I go to look up documentation:

```julia
?unpack
search: uncompact

Couldn't find unpack
Perhaps you meant unstack, unlock, unmark, stack or uncompact
No documentation found.

Binding unpack does not exist.

```

Thoughts? Ive tried updating and re-adding the packages within the MLJ Universe.

MLJ Version=v"0.2.3"  
Julia Version 1.3.1

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [February 13, 2020, 4:24pm UTC](https://discourse.julialang.org/t/mlj-unpack-not-defined/34577/2 "2020-02-13T16:24:22Z")

</div>

That’s a pretty old MLJ version (current stable is 0.9), maybe `unpack` didn’t exist then?

---

<div class="post-metadata">

**Author:** ![Phillip\_Sutton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/phillip_sutton/32/7603_2.png) [@Phillip\_Sutton](https://discourse.julialang.org/u/Phillip_Sutton)\
**Post date:** [February 13, 2020, 4:30pm UTC](https://discourse.julialang.org/t/mlj-unpack-not-defined/34577/3 "2020-02-13T16:30:04Z")

</div>

I thought it looked low… why would I have such an old version of MLJ if i just installed and updated today?

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [February 13, 2020, 4:31pm UTC](https://discourse.julialang.org/t/mlj-unpack-not-defined/34577/4 "2020-02-13T16:31:22Z")

</div>

Must be something holding you back - try `]add MLJ@0.9.0` and the error message will tell you

---

<div class="post-metadata">

**Author:** ![tlienart](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tlienart/32/7640_2.png) [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Post date:** [February 13, 2020, 8:46pm UTC](https://discourse.julialang.org/t/mlj-unpack-not-defined/34577/5 "2020-02-13T20:46:37Z")

</div>

@Phillip_Sutton apologies, you’re experiencing the pains that I warned (on Slack) users may experience due to a significant refactoring cycle that we just completed…  
@nilshg is correct.

The easiest is to `rm` repos that block the way (i.e. other MLJ\* repos) to do so: do `] add MLJBase@0.11` and see what it tells you, remove everything until you can add it. Then add MLJ again. (You should get MLJBase 0.11, MLJ 0.9)

```julia
using MLJBase, RDatasets
boston = dataset("MASS", "boston")
y, X = unpack(boston, ==(:Crim), colname -> true)

```

will return

```julia
([0.00632, 0.02731, 0.02729, 0.03237, ...
...
│ Row │ Zn │ Indus │ Chas │ NOx │ Rm │ Age │ Dis │
│ │ Float64 │ Float64 │ Int64 │ Float64 │ Float64 │ Float64 │ Float64 │
├─────┼─────────┼─────────┼───────┼─────────┼─────────┼─────────┼─────────┤
│ 1 │ 18.0 │ 2.31 │ 0 │ 0.538 │ 6.575 │ 65.2 │ 4.09 │
│ 2 │ 0.0 │ 7.07 │ 0 │ 0.469 │ 6.421 │ 78.9 │ 4.9671 │

```

(I just tested it)

---

<div class="post-metadata">

**Author:** ![Phillip\_Sutton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/phillip_sutton/32/7603_2.png) [@Phillip\_Sutton](https://discourse.julialang.org/u/Phillip_Sutton)\
**Post date:** [February 13, 2020, 9:54pm UTC](https://discourse.julialang.org/t/mlj-unpack-not-defined/34577/6 "2020-02-13T21:54:49Z")

</div>

Thanks @tlienart and @nilshg.

The problems in dependencies kept going and going. I’m on a new system and ended up reinstalling julia adn adding MLJ first. Everything seems to be working now.
