# Using packages installed as dependencies

**URL:** <https://discourse.julialang.org/t/using-packages-installed-as-dependencies/17604>\
**Category:** New to Julia\
**Tags:** package\
**Created:** [November 16, 2018, 5:09pm UTC](https://discourse.julialang.org/t/using-packages-installed-as-dependencies/17604 "2018-11-16T17:09:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![digital\_carver](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/digital_carver/32/33818_2.png) [@digital\_carver](https://discourse.julialang.org/u/digital_carver)\
**Post date:** [November 16, 2018, 5:09pm UTC](https://discourse.julialang.org/t/using-packages-installed-as-dependencies/17604/1 "2018-11-16T17:09:35Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [November 16, 2018, 5:14pm UTC](https://discourse.julialang.org/t/using-packages-installed-as-dependencies/17604/2 "2018-11-16T17:14:56Z")

</div>

> [@digital\_carver](#):
>
> 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?

Yes.

> [@digital\_carver](#):
>
> In general, is it true that only explicitly installed packages can be used with `using` , and not the dependencies they install?

Yes.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [March 24, 2021, 8:20pm UTC](https://discourse.julialang.org/t/using-packages-installed-as-dependencies/17604/3 "2021-03-24T20:20:28Z")

</div>

> [@fredrikekre](#):
>
> > [@](#):
> >
> > In general, is it true that only explicitly installed packages can be used with `using` , and not the dependencies they install?
> 
> Yes.

Any good reason for that?

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

---

<div class="post-metadata">

**Author:** ![00vareladavid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/00vareladavid/32/23521_2.png) [@00vareladavid](https://discourse.julialang.org/u/00vareladavid)\
**Post date:** [March 24, 2021, 9:06pm UTC](https://discourse.julialang.org/t/using-packages-installed-as-dependencies/17604/4 "2021-03-24T21:06:04Z")

</div>

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.
