Searching for a string with help?> gives a list of “nearby” terms that julia knows about. Your status seems to suggest that no package named “OSM” is installed and a quick search on JuliaHub seems to suggest that no such package exists. Are you maybe missing ]add OpenStreetMapX?
I actually have the OpenStreetMatX.jl added as well. Not sure why it didn’t come up in the package status earlier. Just updated it again and tried, to no luck.
Also, I ran ]test Agents and it passes tests (which contain calls to functions in it such asOSM.road). But in the Julia console, I get the error.
This is why I thought that it is an error in loading the submodule. (Also, the open street map functionalities which are deprecated - and outside of the submodule - such as osm_road, are accessible).
Yeah, something is happening with your environment, but exactly what is unclear.
I’ve made a temporary environment ]activate --temp and then added just Agents.
(jl_k8JGTx) pkg> st
Status `/tmp/jl_k8JGTx/Project.toml`
[46ada45e] Agents v4.4.0
julia> using Agents
help?> OSM
search: OSM OSMSpace OSMAgent osm_road osm_latlon osm_plan_route osm_road_length osm_intersection
OSM
Submodule for functionality related to OpenStreetMapSpace. See the docstring of the space for
more info.
One thing you might want to look into is creating one environment per project. Some documentation on that. Especially having al of these different plot libraries in your project can cause version miss-matches - since they are usually large projects that require many packages to work. The probability of one version of those internals not being up-to-date can throw off Pkg.jl’s ability to get you all the right versions.
Still. Since you have Agents v4.4.0 installed, it is quite odd that you cannot see the module. What is your julia version? Can you also post ]st -m for me?
I’ll definitely try creating an environment just for this and report back.
Also the same happens to me when I tried this in Pluto. I think Pluto creates an environment specifically for the notebook, right?
This is what I have in my Pluto
begin
let
env = mktempdir()
import Pkg
Pkg.activate(env)
Pkg.Registry.update()
Pkg.add(Pkg.PackageSpec(;name="PlutoUI", version="0.6.7-0.6"))
Pkg.add("PyPlot")
Pkg.add("Agents")
Pkg.add("Plots")
Pkg.add("OpenStreetMapX")
Pkg.add("OpenStreetMapXPlot")
end
using PlutoUI
using Agents
using Random
using Statistics: mean
using Plots
using OpenStreetMapX
using OpenStreetMapXPlot
end
(Julia-Testing) pkg> activate --temp
Activating new environment at `/var/folders/b9/pknhp85d281_dkf_27q7mllr0000gn/T/jl_fMU16B/Project.toml`
(jl_fMU16B) pkg> add Agents
Resolving package versions...
Updating `/private/var/folders/b9/pknhp85d281_dkf_27q7mllr0000gn/T/jl_fMU16B/Project.toml`
[46ada45e] + Agents v4.4.0
.
.
.
[8e850ede] + nghttp2_jll
[3f19e933] + p7zip_jll
Precompiling project...
? JLD2
? GeometryBasics
? Agents
1 dependency successfully precompiled in 9 seconds (65 already precompiled)
3 dependencies failed but may be precompilable after restarting julia
julia> using Agents
julia> OSM
ERROR: UndefVarError: OSM not defined
julia>
Maybe I need to restart Julia. —update: this worked
(Sorry if I’m spamming… just thought might be better to document step by step, in case it helps you guys in helping me - and in case it helps someone later!)