I have three modules: A, B and C. Module C uses functions from A and B. However, when I try to load modules A, B and C and I try to use a function from C that employs functions from A or B, an error says that functions from A or B are not available.
import A: function1, function 2, ..." andimport B: function3, function 4, …" in module C.
Which version are you on (check with
In 0.7/1.0 you’ll have to
pkg> activate <path/to/ module> the modules environment and
pkg> add <dependency> before it can be used in the module.
An example that should work in the REPL with Julia 1.0:
# define modules
x = double(x)
x = Main.modB.timesThree(x)
# use modules
using .modC, Test
x = 10.
x = combineFunctions(x)
@test x == 60.
The REPL is a different beast, since it knows all about modules defined in itself. The problem only exists when creating a module as a package and trying to import other packages. Those need to be
added in order for the environment of the other package to know about.