# Loaded v1.10.2; receiving LoadError: MethodError: no method matching var"@agent

**URL:** <https://discourse.julialang.org/t/loaded-v1-10-2-receiving-loaderror-methoderror-no-method-matching-var-agent/112549>\
**Category:** Modelling & Simulations\
**Tags:** agentsjl\
**Created:** [April 4, 2024, 9:40pm UTC](https://discourse.julialang.org/t/loaded-v1-10-2-receiving-loaderror-methoderror-no-method-matching-var-agent/112549 "2024-04-04T21:40:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tfranks](https://avatars.discourse-cdn.com/v4/letter/t/898d66/32.png) [@tfranks](https://discourse.julialang.org/u/tfranks)\
**Post date:** [April 4, 2024, 9:40pm UTC](https://discourse.julialang.org/t/loaded-v1-10-2-receiving-loaderror-methoderror-no-method-matching-var-agent/112549/1 "2024-04-04T21:40:20Z")

</div>

Hello,

I’ve installed the latest version 1.10.2 and using the predator-prey example. When I run my code (shown below) and the predator-prey code, both get the same error message:

LoadError: MethodError: no method matching var"@agent

```julia
@agent struct Bank(GridAgent{2})
	uninsured::Int #uninsured deposit to total deposits of 100
	investments::Int #long-term investments to total deposits of 100
	totDep::Int #total deposits 
	health::Bool #open=true or failed=false
	vul::Bool #vulnerable=true or not vulnerable=false
    AFS_securities::Int #available-for-sale securities
end

@agent struct Depositor(GridAgent{2})  
    social_network::Int
end

```

Here are the versions of the installed packages:

Status `~/Project.toml`  
⌅ [46ada45e] Agents v4.3.1  
[7820620d] AgentsPlots v0.4.2  
⌃ [13f3f980] CairoMakie v0.7.5  
⌃ [e9467ef8] GLMakie v0.5.5  
⌃ [ec714cd0] InteractiveDynamics v0.19.5  
⌃ [f0f68f2c] PlotlyJS v0.18.12  
⌃ [91a5bcdd] Plots v1.32.0

Thank you.

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [April 4, 2024, 9:46pm UTC](https://discourse.julialang.org/t/loaded-v1-10-2-receiving-loaderror-methoderror-no-method-matching-var-agent/112549/2 "2024-04-04T21:46:41Z")

</div>

> [@tfranks](#):
>
> ⌅ [46ada45e] Agents v4.3.1

this is 4 years old version.

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [April 4, 2024, 9:47pm UTC](https://discourse.julialang.org/t/loaded-v1-10-2-receiving-loaderror-methoderror-no-method-matching-var-agent/112549/3 "2024-04-04T21:47:28Z")

</div>

> [@tfranks](#):
>
> ⌃ [ec714cd0] InteractiveDynamics v0.19.5

This is deprecated, don’t use it.

Visit latest docs (v6) and copy the example from there!

---

<div class="post-metadata">

**Author:** ![tfranks](https://avatars.discourse-cdn.com/v4/letter/t/898d66/32.png) [@tfranks](https://discourse.julialang.org/u/tfranks)\
**Post date:** [April 4, 2024, 10:14pm UTC](https://discourse.julialang.org/t/loaded-v1-10-2-receiving-loaderror-methoderror-no-method-matching-var-agent/112549/4 "2024-04-04T22:14:26Z")

</div>

Thank you very much.

---

<div class="post-metadata">

**Author:** ![tfranks](https://avatars.discourse-cdn.com/v4/letter/t/898d66/32.png) [@tfranks](https://discourse.julialang.org/u/tfranks)\
**Post date:** [April 4, 2024, 10:32pm UTC](https://discourse.julialang.org/t/loaded-v1-10-2-receiving-loaderror-methoderror-no-method-matching-var-agent/112549/5 "2024-04-04T22:32:06Z")

</div>

I ran the `import Pkg; Pkg.add("Agents")` but is still showing v4.3.1.

Is there something I should check that is preventing the update to v6?

---

<div class="post-metadata">

**Author:** ![abraemer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abraemer/32/51403_2.png) [@abraemer](https://discourse.julialang.org/u/abraemer)\
**Post date:** [April 5, 2024, 1:48am UTC](https://discourse.julialang.org/t/loaded-v1-10-2-receiving-loaderror-methoderror-no-method-matching-var-agent/112549/6 "2024-04-05T01:48:22Z")

</div>

You probably need to remove the InteractiveDynamics.jl package. Also try updating all packages since they all show as outdated. If it doesn’t work please post the terminal lutput here (enclosed in ```).

---

<div class="post-metadata">

**Author:** ![tfranks](https://avatars.discourse-cdn.com/v4/letter/t/898d66/32.png) [@tfranks](https://discourse.julialang.org/u/tfranks)\
**Post date:** [April 5, 2024, 3:24am UTC](https://discourse.julialang.org/t/loaded-v1-10-2-receiving-loaderror-methoderror-no-method-matching-var-agent/112549/7 "2024-04-05T03:24:49Z")

</div>

Hello,

Thank you for your suggestion. I removed all packages with `Pkg.rm(" ")`, added packages, but still not v6.

Status `~/Project.toml`  
⌃ [46ada45e] Agents v4.3.1  
⌃ [13f3f980] CairoMakie v0.7.5  
⌃ [e9467ef8] GLMakie v0.5.5  
[9a3f8284] Random  
Info Packages marked with ⌃ have new versions available and may be upgradable.

I’ll close the file and VS Code to see if that will clear something out. Thanks.

---

<div class="post-metadata">

**Author:** ![tfranks](https://avatars.discourse-cdn.com/v4/letter/t/898d66/32.png) [@tfranks](https://discourse.julialang.org/u/tfranks)\
**Post date:** [April 5, 2024, 3:34am UTC](https://discourse.julialang.org/t/loaded-v1-10-2-receiving-loaderror-methoderror-no-method-matching-var-agent/112549/8 "2024-04-05T03:34:38Z")

</div>

Hooray. Closing and restarting worked. Thank you so much!

Status `~/.julia/environments/v1.10/Project.toml`  
[46ada45e] Agents v6.0.7  
[13f3f980] CairoMakie v0.11.10  
[9a3f8284] Random
