# Agents.jl: OpenStreetMaps example of zombie outbreak not running

**URL:** https://discourse.julialang.org/t/agents-jl-openstreetmaps-example-of-zombie-outbreak-not-running/131909
**Category:** General Usage
**Created:** [August 28, 2025, 8:20am UTC](https://discourse.julialang.org/t/agents-jl-openstreetmaps-example-of-zombie-outbreak-not-running/131909 "2025-08-28T08:20:01Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![xlejx-rodsxn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xlejx-rodsxn/32/23774_2.png) [@xlejx-rodsxn](https://discourse.julialang.org/u/xlejx-rodsxn)
#### Post date: [August 28, 2025, 8:20am UTC](https://discourse.julialang.org/t/agents-jl-openstreetmaps-example-of-zombie-outbreak-not-running/131909/1 "2025-08-28T08:20:01Z")

</div>

Hi, currently learning Julia and the Agents.jl library. So far, I’ve managed to reproduce other examples in the package tutorials, so I guess it has nothing to do with versions(?).

The code is taken from [Zombie Outbreak in a City · Agents.jl](https://juliadynamics.github.io/Agents.jl/stable/examples/zombies/)

and the zombie outbreak is throwing the following error (I think at the visualization part? because I can step the model forward, just can’t seem to get the nice plot in the example)

Thanks for any hints as to what might be going on.

If is of any help, after trying to update Julia, I get that there were 2 direct dependencies failing to precompile: AgentsGraphVisualizations and AgentsOSMVisualizations. I think these are also responsible for the error:

{  
“name”: “LoadError”,  
“message”: "MethodError: no method matching agents\_space\_dimensionality(::Agents.OSM.OpenStreetMapSpace)  
The function `agents_space_dimensionality` exists, but no method is defined for this combination of argument types.

Closest candidates are:  
agents\_space\_dimensionality(::Nothing)  
@ AgentsVisualizations ~/.julia/packages/Agents/dTr7O/ext/AgentsVisualizations/src/spaces/nothing.jl:5  
agents\_space\_dimensionality(::AgentBasedModel{Nothing})  
@ AgentsVisualizations ~/.julia/packages/Agents/dTr7O/ext/AgentsVisualizations/src/spaces/nothing.jl:3  
agents\_space\_dimensionality(::AgentBasedModel)  
@ AgentsVisualizations ~/.julia/packages/Agents/dTr7O/ext/AgentsVisualizations/src/spaces/abstract.jl:1  
…  
",  
“stack”: "MethodError: no method matching agents\_space\_dimensionality(::Agents.OSM.OpenStreetMapSpace)  
The function `agents_space_dimensionality` exists, but no method is defined for this combination of argument types.

Closest candidates are:  
agents\_space\_dimensionality(::Nothing)  
@ AgentsVisualizations ~/.julia/packages/Agents/dTr7O/ext/AgentsVisualizations/src/spaces/nothing.jl:5  
agents\_space\_dimensionality(::AgentBasedModel{Nothing})  
@ AgentsVisualizations ~/.julia/packages/Agents/dTr7O/ext/AgentsVisualizations/src/spaces/nothing.jl:3  
agents\_space\_dimensionality(::AgentBasedModel)  
@ AgentsVisualizations ~/.julia/packages/Agents/dTr7O/ext/AgentsVisualizations/src/spaces/abstract.jl:1  
…

Stacktrace:  
[1] agents\_space\_dimensionality(model::StandardABM{Agents.OSM.OpenStreetMapSpace, Zombie, Dict{Int64, Zombie}, Tuple{DataType}, typeof(zombie\_step!), typeof(dummystep), typeof(Agents.Schedulers.fastest), Dict{Symbol, Float64}, MersenneTwister})  
@ AgentsVisualizations ~/.julia/packages/Agents/dTr7O/ext/AgentsVisualizations/src/spaces/abstract.jl:1  
[2] axistype(model::StandardABM{Agents.OSM.OpenStreetMapSpace, Zombie, Dict{Int64, Zombie}, Tuple{DataType}, typeof(zombie\_step!), typeof(dummystep), typeof(Agents.Schedulers.fastest), Dict{Symbol, Float64}, MersenneTwister})  
@ AgentsVisualizations ~/.julia/packages/Agents/dTr7O/ext/AgentsVisualizations/src/abmplot.jl:15  
[3] abmplot(model::StandardABM{Agents.OSM.OpenStreetMapSpace, Zombie, Dict{Int64, Zombie}, Tuple{DataType}, typeof(zombie\_step!), typeof(dummystep), typeof(Agents.Schedulers.fastest), Dict{Symbol, Float64}, MersenneTwister}; figure::@NamedTuple{size::Tuple{Int64, Int64}}, axis::@NamedTuple{title::Observable{String}, titlealign::Symbol}, warn\_deprecation::Bool, kwargs::@Kwargs{add\_controls::Bool, agent\_color::typeof(zombie\_color), agent\_size::typeof(zombie\_size)})  
@ AgentsVisualizations ~/.julia/packages/Agents/dTr7O/ext/AgentsVisualizations/src/abmplot.jl:8  
[4] abmvideo(file::String, model::StandardABM{Agents.OSM.OpenStreetMapSpace, Zombie, Dict{Int64, Zombie}, Tuple{DataType}, typeof(zombie\_step!), typeof(dummystep), typeof(Agents.Schedulers.fastest), Dict{Symbol, Float64}, MersenneTwister}; spf::Nothing, dt::Int64, framerate::Int64, frames::Int64, title::String, showstep::Bool, figure::@NamedTuple{size::Tuple{Int64, Int64}}, axis::@NamedTuple{}, recordkwargs::@NamedTuple{compression::Int64}, kwargs::@Kwargs{agent\_color::typeof(zombie\_color), agent\_size::typeof(zombie\_size)})  
@ AgentsVisualizations ~/.julia/packages/Agents/dTr7O/ext/AgentsVisualizations/src/convenience.jl:115  
[5] top-level scope  
@ In[7]:6"  
}

---

<div class="post-metadata">

### Author: ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)
#### Post date: [August 28, 2025, 8:27am UTC](https://discourse.julialang.org/t/agents-jl-openstreetmaps-example-of-zombie-outbreak-not-running/131909/2 "2025-08-28T08:27:26Z")

</div>

See:

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

In particular, I guess you want to:

- Mention Agents.jl in the post title

- Enclose code in Markdown code blocks using backticks

---

<div class="post-metadata">

### Author: ![xlejx-rodsxn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xlejx-rodsxn/32/23774_2.png) [@xlejx-rodsxn](https://discourse.julialang.org/u/xlejx-rodsxn)
#### Post date: [August 28, 2025, 5:37pm UTC](https://discourse.julialang.org/t/agents-jl-openstreetmaps-example-of-zombie-outbreak-not-running/131909/3 "2025-08-28T17:37:54Z")

</div>

Thanks. I changed the title. Just to clarify, there is no code in my post. I just pasted the error that the example code in the Agents.jl package throws at me. The actual code is on their official documentation (link above, Zombie outbreak in a city)

---

<div class="post-metadata">

### Author: ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)
#### Post date: [August 28, 2025, 5:45pm UTC](https://discourse.julialang.org/t/agents-jl-openstreetmaps-example-of-zombie-outbreak-not-running/131909/4 "2025-08-28T17:45:34Z")

</div>

> [@xlejx-rodsxn](#):
>
> Just to clarify, there is no code in my post. I just pasted the error

Yes, the error is what I meant by “code”. The goal is to have it readable, and prevent contents being misinterpreted as Markdown syntax and `@user` mentions.

---

<div class="post-metadata">

### Author: ![cchderrick](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@cchderrick](https://discourse.julialang.org/u/cchderrick)
#### Post date: [August 29, 2025, 4:13pm UTC](https://discourse.julialang.org/t/agents-jl-openstreetmaps-example-of-zombie-outbreak-not-running/131909/5 "2025-08-29T16:13:03Z")

</div>

> [@xlejx-rodsxn](#):
>
> ```julia-auto
> MethodError: no method matching agents_space_dimensionality(::Agents.OSM.OpenStreetMapSpace)
> The function `agents_space_dimensionality` exists, but no method is defined for this combination of argument types.
> 
> Closest candidates are:
> agents_space_dimensionality(::Nothing)
> @ AgentsVisualizations ~/.julia/packages/Agents/dTr7O/ext/AgentsVisualizations/src/spaces/nothing.jl:5
> agents_space_dimensionality(::AgentBasedModel{Nothing})
> @ AgentsVisualizations ~/.julia/packages/Agents/dTr7O/ext/AgentsVisualizations/src/spaces/nothing.jl:3
> agents_space_dimensionality(::AgentBasedModel)
> @ AgentsVisualizations ~/.julia/packages/Agents/dTr7O/ext/AgentsVisualizations/src/spaces/abstract.jl:1
> 
> ```

Hi, welcome.  
Here is how to read Julia error log. I don’t use Agents.jl, but this is the main error, and it said there is a method call `agents_space_dimensionality` but that method does not take `OpenStreetMapSpace` as input. Probably need some time to read the doc, as it seems the example is outdated.

---

<div class="post-metadata">

### Author: ![eldee](https://avatars.discourse-cdn.com/v4/letter/e/b5a626/32.png) [@eldee](https://discourse.julialang.org/u/eldee)
#### Post date: [August 30, 2025, 9:49am UTC](https://discourse.julialang.org/t/agents-jl-openstreetmaps-example-of-zombie-outbreak-not-running/131909/6 "2025-08-30T09:49:58Z")

</div>

> [@cchderrick](#):
>
> as it seems the example is outdated.

It works fine for me on Julia 1.11.5 using

```julia-auto
 [46ada45e] Agents v6.2.10
 [13f3f980] CairoMakie v0.12.18
 [76b6901f] OSMMakie v0.0.10
 [9a3f8284] Random v1.11.0

```

The proper method for `agents_space_dimensionality` indeed exists:

```julia-repl
julia> methods(Agents.agents_space_dimensionality)
# 7 methods for generic function "agents_space_dimensionality" from Agents:
 [1] agents_space_dimensionality(::Agents.OSM.OpenStreetMapSpace)
(...)

```

> [@xlejx-rodsxn](#):
>
> after trying to update Julia, I get that there were 2 direct dependencies failing to precompile: AgentsGraphVisualizations and AgentsOSMVisualizations. I think these are also responsible for the error:

I would indeed expect this to be responsible for the error. Have you tried reinstalling Agents.jl etc.?

---

<div class="post-metadata">

### Author: ![xlejx-rodsxn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xlejx-rodsxn/32/23774_2.png) [@xlejx-rodsxn](https://discourse.julialang.org/u/xlejx-rodsxn)
#### Post date: [September 1, 2025, 7:17am UTC](https://discourse.julialang.org/t/agents-jl-openstreetmaps-example-of-zombie-outbreak-not-running/131909/7 "2025-09-01T07:17:28Z")

</div>

Thanks for your reply. This is what I get when trying to re install the package:

```julia-auto
   Resolving package versions...
  No Changes to `~/.julia/environments/v1.11/Project.toml`
  No Changes to `~/.julia/environments/v1.11/Manifest.toml`
Precompiling project...
  ✗ Agents → AgentsGraphVisualizations
  ✗ Agents → AgentsOSMVisualizations
  0 dependencies successfully precompiled in 6 seconds. 545 already precompiled.
  2 dependencies errored.
  For a report of the errors see `julia> err`. To retry use `pkg> precompile`

julia> err
PkgPrecompileError: The following 2 direct dependencies failed to precompile:

AgentsGraphVisualizations 

Failed to precompile AgentsGraphVisualizations [fc457f6c-ecc5-5e53-a4cf-8c57f0a5571f] to "/Users/rodsxn/.julia/compiled/v1.11/AgentsGraphVisualizations/jl_dTRxzv".
ERROR: LoadError: TypeError: in Type{...} expression, expected UnionAll, got a value of type Nothing
Stacktrace:
 [1] top-level scope
   @ ~/.julia/packages/Agents/WuWeG/ext/AgentsGraphVisualizations/AgentsGraphVisualizations.jl:6
 [2] include
   @ ./Base.jl:557 [inlined]
 [3] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
   @ Base ./loading.jl:2790
 [4] top-level scope
   @ stdin:5
in expression starting at /Users/rodsxn/.julia/packages/Agents/WuWeG/ext/AgentsGraphVisualizations/AgentsGraphVisualizations.jl:2
in expression starting at stdin:5
AgentsOSMVisualizations 

Failed to precompile AgentsOSMVisualizations [611693d8-6f0d-5891-a6b2-55fbcd232bbf] to "/Users/rodsxn/.julia/compiled/v1.11/AgentsOSMVisualizations/jl_Q2X9BP".
ERROR: LoadError: TypeError: in Type{...} expression, expected UnionAll, got a value of type Nothing
Stacktrace:
 [1] top-level scope
   @ ~/.julia/packages/Agents/WuWeG/ext/AgentsOSMVisualizations/AgentsOSMVisualizations.jl:5
 [2] include
   @ ./Base.jl:557 [inlined]
 [3] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
   @ Base ./loading.jl:2790
 [4] top-level scope
   @ stdin:5
in expression starting at /Users/rodsxn/.julia/packages/Agents/WuWeG/ext/AgentsOSMVisualizations/AgentsOSMVisualizations.jl:1
in expression starting at stdin:5

```

And after removing and reinstalling the package I get the following:

```julia-auto
(@v1.11) pkg> add Agents
   Resolving package versions...
    Updating `~/.julia/environments/v1.11/Project.toml`
  [46ada45e] + Agents v6.2.10
    Updating `~/.julia/environments/v1.11/Manifest.toml`
  [46ada45e] + Agents v6.2.10
  [38540f10] + CommonSolve v0.2.4
  [49057fa9] + HybridStructs v0.2.1
  [f56206fc] + LightSumTypes v5.2.1
  [925886fa] + OnlineStatsBase v1.7.1
  [94ee1d12] + Quaternions v0.7.6
  [6038ab10] + Rotations v1.7.1
⌅ [ff63dad9] + StreamSampling v0.6.9
        Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`
Precompiling project...
  ✗ Agents → AgentsGraphVisualizations
  ✗ Agents → AgentsOSMVisualizations
  0 dependencies successfully precompiled in 6 seconds. 545 already precompiled.
  2 dependencies errored.
  For a report of the errors see `julia> err`. To retry use `pkg> precompile`

(@v1.11) pkg> 

```

No clue what is going on or how come others can run it ☹

---

<div class="post-metadata">

### Author: ![xlejx-rodsxn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xlejx-rodsxn/32/23774_2.png) [@xlejx-rodsxn](https://discourse.julialang.org/u/xlejx-rodsxn)
#### Post date: [September 1, 2025, 1:59pm UTC](https://discourse.julialang.org/t/agents-jl-openstreetmaps-example-of-zombie-outbreak-not-running/131909/8 "2025-09-01T13:59:01Z")

</div>

After reinstalling everything once again (all of Julia) and trying it in both Pluto and VS code I solved it!
