# Problems running Interact with julia 0.5

**URL:** <https://discourse.julialang.org/t/problems-running-interact-with-julia-0-5/1860>\
**Category:** New to Julia\
**Created:** [February 2, 2017, 10:57pm UTC](https://discourse.julialang.org/t/problems-running-interact-with-julia-0-5/1860 "2017-02-02T22:57:18Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramonz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ramonz/32/548_2.png) [@ramonz](https://discourse.julialang.org/u/ramonz)\
**Post date:** [February 2, 2017, 10:57pm UTC](https://discourse.julialang.org/t/problems-running-interact-with-julia-0-5/1860/1 "2017-02-02T22:57:18Z")

</div>

Hello

I had some scripts using Interact which were running fine under julia 0.4.5 but when I tried to run them with julia 0.5 I get the following error:

MethodError: objects of type Array{Float64,1} are not callable Use square brackets for indexing an Array

Can anybody help?

Cheers

Ramon

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [February 3, 2017, 4:28am UTC](https://discourse.julialang.org/t/problems-running-interact-with-julia-0-5/1860/2 "2017-02-03T04:28:59Z")

</div>

> [@ramonz](#):
>
> I had some scripts using Interact which were running fine under julia 0.4.5 but when I tried to run them with julia 0.5 I get the following error:
> 
> MethodError: objects of type Array

That sounds like an error of trying to copy paste MATLAB code `A(4)` into Julia, when it should be `A[4]`.

---

<div class="post-metadata">

**Author:** ![felix](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/felix/32/604_2.png) [@felix](https://discourse.julialang.org/u/felix)\
**Post date:** [February 3, 2017, 8:05am UTC](https://discourse.julialang.org/t/problems-running-interact-with-julia-0-5/1860/3 "2017-02-03T08:05:35Z")

</div>

If it is [Interact.jl](https://github.com/JuliaGizmos/Interact.jl) you’re using, I also had some problems with it previously. I think it may need some maintenance to move it up to `v"0.5"`, and certainly some to move it up to `v"0.6.0-dev"`, to accommodate the syntax changes since `v"0.4"`. If you feel comfortable with it, I’m sure a PR would be appreciated.

Here’s the build status, note it’s not even configured for `v"0.5"`: [Travis CI - Test and Deploy Your Code with Confidence](https://travis-ci.org/JuliaGizmos/Interact.jl)

---

<div class="post-metadata">

**Author:** ![ramonz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ramonz/32/548_2.png) [@ramonz](https://discourse.julialang.org/u/ramonz)\
**Post date:** [February 3, 2017, 6:39pm UTC](https://discourse.julialang.org/t/problems-running-interact-with-julia-0-5/1860/4 "2017-02-03T18:39:05Z")

</div>

Thanks for your reply, Chris.

No, the script was written as a IJulia notebook which was just read and run by the new version.

Thanks anyway

---

<div class="post-metadata">

**Author:** ![ramonz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ramonz/32/548_2.png) [@ramonz](https://discourse.julialang.org/u/ramonz)\
**Post date:** [February 3, 2017, 6:39pm UTC](https://discourse.julialang.org/t/problems-running-interact-with-julia-0-5/1860/5 "2017-02-03T18:39:06Z")

</div>

Thanks Felix

So, It looks like I will have to wait till the maintenance is carried out, too bad since I was using it for some classes and now I have to move back to 0.4 to run it.

Cheers

Ramón

By the way, sorry but what does PR mean?

---

<div class="post-metadata">

**Author:** ![tshort](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tshort/32/43_2.png) [@tshort](https://discourse.julialang.org/u/tshort)\
**Post date:** [February 3, 2017, 6:51pm UTC](https://discourse.julialang.org/t/problems-running-interact-with-julia-0-5/1860/6 "2017-02-03T18:51:35Z")

</div>

“PR” stands for “pull request”. If your issue is because of a problem in a package, and you find a fix for it, you can open a pull request on GitHub to have that fix included with the package.

For package problems, it’s often best to open an issue at the package repository. It also helps if you can include the code that’s causing the problem.

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [February 3, 2017, 7:17pm UTC](https://discourse.julialang.org/t/problems-running-interact-with-julia-0-5/1860/7 "2017-02-03T19:17:40Z")

</div>

I’m using Interact.jl regularly with julia 0.5 on both mac and linux, so it definitely _should_ work. Can you provide more detail about the problem? Is there more to the error message than what you included in your first post? What code are you executing when the error happens?

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [February 3, 2017, 8:04pm UTC](https://discourse.julialang.org/t/problems-running-interact-with-julia-0-5/1860/8 "2017-02-03T20:04:38Z")

</div>

Is it using some pre-existing Jupyter installation?  
I suggest you try the following:

```julia
ENV["JUPYTER"]="" 
Pkg.build("IJulia")`

```

You could also try deleting the `.julia` directory in your home directory and reinstalling the packages.

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [February 3, 2017, 8:22pm UTC](https://discourse.julialang.org/t/problems-running-interact-with-julia-0-5/1860/9 "2017-02-03T20:22:53Z")

</div>

I’ve opened a PR to add julia 0.5 builds to Interact, which should help us determine if there really is an issue: [https://github.com/JuliaGizmos/Interact.jl/pull/157](https://github.com/JuliaGizmos/Interact.jl/pull/157)

---

<div class="post-metadata">

**Author:** ![ramonz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ramonz/32/548_2.png) [@ramonz](https://discourse.julialang.org/u/ramonz)\
**Post date:** [February 4, 2017, 11:59pm UTC](https://discourse.julialang.org/t/problems-running-interact-with-julia-0-5/1860/10 "2017-02-04T23:59:27Z")

</div>

Thanks for your help this is the simple code that used to work under 0.4.5 and now it does not:

x = linspace(1,500)  
@manipulate for α=0.001:0.001:0.02, β= 0:0.1:5  
Gadfly.plot(layer(x=x,y=α\*x+β, Geom.line),  
layer(x=series[:,1]/1000, y=series[:,2], Geom.point),  
Guide.xlabel(“Longitude”), Guide.ylabel(“Disp”), Guide.title(“Disp Vs Longitude”))  
end

where  
series[:,4] is just a four column array

this is the error now:

MethodError: `call` has no method matching call(::Array{Float64,1}, ::Base.KeyIterator{Dict{ASCIIString,Int64}})  
Closest candidates are:  
BoundsError()  
BoundsError(::Any…)  
DivideError()  
…

in notify at /Users/ramon/.julia/v0.4/Interact/src/IJulia/setup.jl:77  
in init\_comm at /Users/ramon/.julia/v0.4/Interact/src/IJulia/setup.jl:82  
in metadata at /Users/ramon/.julia/v0.4/Interact/src/IJulia/setup.jl:91  
in execute\_request at /Users/ramon/.julia/v0.4/IJulia/src/execute\_request.jl:187  
in eventloop at /Users/ramon/.julia/v0.4/IJulia/src/eventloop.jl:8  
in anonymous at task.jl:447

---

<div class="post-metadata">

**Author:** ![ramonz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ramonz/32/548_2.png) [@ramonz](https://discourse.julialang.org/u/ramonz)\
**Post date:** [February 5, 2017, 12:08am UTC](https://discourse.julialang.org/t/problems-running-interact-with-julia-0-5/1860/11 "2017-02-05T00:08:35Z")

</div>

I already tried changing the environment variable for JUPYTER and did a Pkg.build(“IJulia”) since that didn’t work I deleted everything in .julia and installed from fresh using the 0.4.7 version just to try it out.  
I got the same error.

---

<div class="post-metadata">

**Author:** ![ramonz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ramonz/32/548_2.png) [@ramonz](https://discourse.julialang.org/u/ramonz)\
**Post date:** [February 5, 2017, 12:19am UTC](https://discourse.julialang.org/t/problems-running-interact-with-julia-0-5/1860/12 "2017-02-05T00:19:35Z")

</div>

this is a sample of my data file series2

70000.0 2.2 4.1 3.0e10  
80000.0 3.1 7.9 3.0e10  
37000.0 2.5 6.2 3.0e10  
61000.0 1.8 5.8 3.1e10  
35000.0 1.1 3.5 3.3e10  
60000.0 1.6 3.3 2.5e10  
28000.0 1.66 1.9 3.2e10  
10500.0 0.6 1.5 3.3e10  
155000.0 2.1 3.5 3.2e10  
4000.0 1.3 2.1 3.0e10  
62000.0 1.1 5.2 3.0e10  
47000.0 0.8 3.1 3.0e10  
25000.0 2.5 5.4 3.0e10

---

<div class="post-metadata">

**Author:** ![ramonz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ramonz/32/548_2.png) [@ramonz](https://discourse.julialang.org/u/ramonz)\
**Post date:** [February 5, 2017, 12:20am UTC](https://discourse.julialang.org/t/problems-running-interact-with-julia-0-5/1860/13 "2017-02-05T00:20:51Z")

</div>

sorry, called series not series2 in the code

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [February 5, 2017, 4:29am UTC](https://discourse.julialang.org/t/problems-running-interact-with-julia-0-5/1860/14 "2017-02-05T04:29:25Z")

</div>

I’ve tried running your code on my machine (OSX with Julia 0.5) and it worked just fine. I also tried it on JuliaBox with Julia 0.4.7 and Julia 0.5, and it worked fine in both cases.

To be clear, this is the exact code that I ran:

```julia
using Interact
using Gadfly

x = linspace(1,500)
series = [
70000.0 2.2 4.1 3.0e10
80000.0 3.1 7.9 3.0e10
37000.0 2.5 6.2 3.0e10
61000.0 1.8 5.8 3.1e10
35000.0 1.1 3.5 3.3e10
60000.0 1.6 3.3 2.5e10
28000.0 1.66 1.9 3.2e10
10500.0 0.6 1.5 3.3e10
155000.0 2.1 3.5 3.2e10
4000.0 1.3 2.1 3.0e10
62000.0 1.1 5.2 3.0e10
47000.0 0.8 3.1 3.0e10
25000.0 2.5 5.4 3.0e10
]
@manipulate for α=0.001:0.001:0.02, β= 0:0.1:5 
    Gadfly.plot(layer(x=x,y=α*x+β, Geom.line),
    layer(x=series[:,1]/1000, y=series[:,2], Geom.point),
    Guide.xlabel("Longitude"), Guide.ylabel("Disp"), Guide.title("Disp Vs Longitude"))
end

```

Are you certain that’s exactly the code that you were running too?

---

<div class="post-metadata">

**Author:** ![ramonz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ramonz/32/548_2.png) [@ramonz](https://discourse.julialang.org/u/ramonz)\
**Post date:** [February 6, 2017, 7:25pm UTC](https://discourse.julialang.org/t/problems-running-interact-with-julia-0-5/1860/15 "2017-02-06T19:25:52Z")

</div>

Sorry to all.  
The problem was strange, But after your reply it was solved once I closed and re-opened the notebook .  
Something must have been hanging around which caused the conflict.  
I now works with both versions of julia.

Thank you for your time, although I still do not know what exactly went wrong.

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [February 6, 2017, 7:42pm UTC](https://discourse.julialang.org/t/problems-running-interact-with-julia-0-5/1860/16 "2017-02-06T19:42:01Z")

</div>

No worries. I’m glad it’s working now

---

<div class="post-metadata">

**Author:** ![ramonz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ramonz/32/548_2.png) [@ramonz](https://discourse.julialang.org/u/ramonz)\
**Post date:** [February 7, 2017, 3:22pm UTC](https://discourse.julialang.org/t/problems-running-interact-with-julia-0-5/1860/17 "2017-02-07T15:22:39Z")

</div>

Altough I still wonder since the first time Interact crashed was while copying the notebook to a fresh installation of julia on a laptop…  
Anyway, thanks again
