3
votes

I've written a module in Julia using PkgTemplates package. The module is saved in C:/Users/me/.julia/dev/MyModule folder.

I cannot load the module in other sessions. I've tried push!(LOAD_PATH, path) but didn't work.

Only include("C:/Users/me/dev/MyModule/src/MyModule.jl") works but in this case I can only use the functions in the module using MyModule.myfunction().

I couldn't find any other way to load the module.

1

1 Answers

6
votes

You should use Pkg.develop (or pkg> develop in the Pkg REPL mode), see https://julialang.github.io/Pkg.jl/v1/managing-packages/#Adding-a-local-package-1. Pkg.develop is basically Pkg.add but you install from a local path, for example

julia> using Pkg

julia> Pkg.develop(PackageSpec(path = "C:/Users/me/dev/MyModule"))

or in the REPL mode:

pkg> develop C:/Users/me/dev/MyModule