REPL workflow reload doesn't work

I think I followed:

but it doesn’t seem to work.

Created Tmp.jl
Inside Tmp.jl:

module Tmp


Then started the REPL


works fine, but


produces this error:

ERROR: ArgumentError: Module Tmp not found in current path.
Run `Pkg.add("Tmp")` to install the Tmp package.
 [1] reload(::String) at ./loading.jl:371
 [2] macro expansion at ./REPL.jl:97 [inlined]
 [3] (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:73

In your case, rather than calling reload, you can just do include("Tmp.jl") again.

The manual, on the other hand, is assuming that the Tmp.jl file is somewhere on your LOAD_PATH and that you’ve loaded it with:

import Tmp

rather than include("Tmp.jl").

You can read more about LOAD_PATH here:

To include your current directory in LOAD_PATH, do:

julia> push!(LOAD_PATH, pwd())                     

julia> import Tmp

julia> reload("Tmp")
WARNING: replacing module Tmp

By the way, I think the manual is not very clear on this point, so I’ve opened a PR to improve it:

Also, you can automate everything with the magical

1 Like

IIRC, Revise won’t automatically track files loaded by include. So for a workflow involving files not in the LOAD_PATH, some extra work would be needed to have Revise track those files, right?

I think you are right, see
But practically, packages are so lightweight that I do all nontrivial development using one, so this is not a constraint for me.