Agreed. I think you are correct here (assuming I understand your setup).
Again, if I understand your setup correctly, this is because:
- Package
Exampleis using packageDataframes…
And yet:
- Package
Dataframeswas not "add"ed to packageExample’sproject.tomlfile (dependency list).
Why does Julia treat these cases differently?
Considering the situation from your first example:
- when
using Dataframesis launched from the REPL.
Your current Julia session is clearly using an environment stack that defines Dataframes, so the session should be able to access this package.
On the other hand, in your second example:
using Dataframesis called from within packageExample.
To Julia, this makes a huge difference. Julia wants to ensure all dependencies are clearly included in each package’s project.toml file.
If I were to guess, I would think this was done to ensure a smooth package installation experience in Julia:
- By ensuring that all dependencies are present in the
project.tomlfile, the package manager can correctly assume a package will work if all dependencies fromproject.tomlare installed.
…Barring any mistakes in how the version compatibility ranges were specified (and other similar potential issues).