using MyMod
[ Info: Precompiling MyMod [top-level]
WARNING: --output requested, but no modules defined during run
┌ Warning: The call to compilecache failed to create a usable precompiled cache file for MyMod [top-level]
│ exception = ArgumentError: Invalid header in cache file /home/maah/.julia/compiled/v1.5/MyMod.ji.
└ @ Base loading.jl:1042
ERROR: KeyError: key MyMod [top-level] not found
Stacktrace:
[1] getindex at ./dict.jl:467 [inlined]
[2] root_module at ./loading.jl:968 [inlined]
[3] require(::Base.PkgId) at ./loading.jl:934
[4] require(::Module, ::Symbol) at ./loading.jl:923
You don’t need to edit any paths to get relative import using .MyMod works.
All error messages, especially the warning you got with using MyMod points to that you didn’t actually have the content you expect in your MyMod.jl. Did you save the file, and saved it to the right path?