I created a module, myModule, that requires the Dates and DataFrames packages.
Fwiw, my src directory contains only myModule.jl which looks like:
module myModule
using DataFrames, Dates
export myDF
function myDF()
df = DataFrame(a = [1, 2, 3], b = [4, 5, 6], c = [today(), today() + Day(1), today() + Day(2)])
return df
end
end # module myModule
and my Project.toml file looks like
name = "myModule"
uuid = "c3019312-639c-46e1-a276-88058c088531"
authors = ["ADANNENBERG <alex.dannenberg@gmail.com>"]
version = "0.1.0"
[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
The command
using myModule
is sufficient for the module to work in the REPL or in VS Code, i.e. sufficient to make the exported function myDF() work fine in the REPL or VS Code.
In Pluto, however, it appears that the “using DataFrames, Dates” line in myModule is not used or recognized. Instead, when I’m in Pluto I have to use the command
using myModule, DataFrames, Dates
in order not to throw an error.
This was a toy example, but it’s true for every module I’ve created: In the REPL or VS Code I just have to have a line “using moduleName” and all the exported functions in the module work fine. But in Pluto “using moduleName” will bug and tell me that the packages that moduleName depends upon are not found. In Pluto I can only make moduleName work if I have the line “using moduleName, Dates, DataFrames”…
Is this a feature of Pluto, or a sign that I’ve got a problem in myModule that doesn’t cause the REPL or VS Code to bug?