Hi all,
I want to import some modules containing variables and functions for my project.
Down below is a simplified version of my Main module (forward / in Linux). Why does such an error occur ?
module Main
include("Modules/ModFunc.jl") # this works
import ModFunc # the error occurs here
end
WARNING: replacing module Main.
ERROR: LoadError: ArgumentError: Package ModFunc not found in current path:
- Run
import Pkg; Pkg.add("ModFunc")
to install the ModFunc package.
Writing instead
module Main
push!(LOAD_PATH, "./Modules")
include("ModFunc.jl")
import ModFunc
end
generates the output:
WARNING: replacing module Main.
ERROR: LoadError: could not open file /home/…/FileWhereMyMainIs/ModFunc.jl
Thank you for your attention
EDIT: the module looks like
module ModFunc
export func
function func()
return 0
end
end