Using packages installed as dependencies

I have DataFrames installed, and as a dependency of that, StatsBase as well. I assumed that StatsBase was available to use as a package of its own. But using StatsBase fails “not found in current path” error.

After some digging, I found that my load_path() returns \\.julia\\environments\\v1.0\\Project.toml (and a stdlib entry). So I’m guessing only the packages installed manually are available to be loaded with a using statement, and not the dependencies installed alongside them?

So, if I wanted to use StatsBase.countmap, do I need to do an add StatsBase explicitly, even though the package already exists in my packages directory? In general, is it true that only explicitly installed packages can be used with using, and not the dependencies they install?

Yes.

Yes.

2 Likes

Any good reason for that?

(I was about to post a new topic, but this is exactly the same)

You could (for example) be using a certain package which exists in your current dependency graph, then you upgrade, the upgrade causes that package to be removed (since it is not a direct dependency), and now your code will be broken.

2 Likes