I am developing a Julia package, say “PackA.jl”. It depends on many other packages, for example, “JSON.jl”.
I put JOSN
both to Project.toml
and REQUIRE
.
In the main source file, “PackA.jl”, there’s a line to use JSON:
using JSON
Then I start julia REPL like this, in the root dir of PackA.jl:
julia --project=.
And:
julia> using JSON
ERROR: ArgumentError: Package JSON not found in current path:
- Run `import Pkg; Pkg.add("JSON")` to install the JSON package.
Stacktrace:
[1] require(::Module, ::Symbol) at ./loading.jl:876
julia> using PackA.JSON
julia> using JSON
ERROR: ArgumentError: Package JSON not found in current path:
- Run `import Pkg; Pkg.add("JSON")` to install the JSON package.
Stacktrace:
[1] require(::Module, ::Symbol) at ./loading.jl:876
julia> JSON
JSON
JSON can only be imported through PackA but can’t be imported directly. Is this by design?
Thanks.