# How to get the directory of an indirect dependency

**URL:** https://discourse.julialang.org/t/how-to-get-the-directory-of-an-indirect-dependency/58708
**Category:** Package Management
**Created:** [April 6, 2021, 6:34pm UTC](https://discourse.julialang.org/t/how-to-get-the-directory-of-an-indirect-dependency/58708 "2021-04-06T18:34:37Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![danielmatz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielmatz/32/2285_2.png) [@danielmatz](https://discourse.julialang.org/u/danielmatz)
#### Post date: [April 6, 2021, 6:34pm UTC](https://discourse.julialang.org/t/how-to-get-the-directory-of-an-indirect-dependency/58708/1 "2021-04-06T18:34:37Z")

</div>

I’m trying to write a script that analyzes all of the dependencies of a Julia project, including the indirect dependencies. I see how I can use `pathof` to get the path to the direct dependencies, but how can I do this for the indirect dependencies? Since they aren’t direct dependencies, they can’t be imported, so I can’t get access to the module to be able to pass it to `pathof`.

Thanks!

---

<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: [April 6, 2021, 6:41pm UTC](https://discourse.julialang.org/t/how-to-get-the-directory-of-an-indirect-dependency/58708/2 "2021-04-06T18:41:03Z")

</div>

Not directly equivalent, since it will give you the project directory instead of the entrypoint file, but:

```julia
julia> for (uuid, info) in Pkg.dependencies()
           println("$(uuid) $(info.name) $(info.source)")
       end
29816b5a-b9ab-546f-933c-edad1886dfa8 LibSSH2_jll /home/david/.bin/julia-1.6.0/share/julia/stdlib/v1.6/LibSSH2_jll
4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5 Unicode /home/david/.bin/julia-1.6.0/share/julia/stdlib/v1.6/Unicode
6462fe0b-24de-5631-8697-dd941f90decc Sockets /home/david/.bin/julia-1.6.0/share/julia/stdlib/v1.6/Sockets
ca575930-c2e3-43a9-ace4-1e988b2c1908 NetworkOptions /home/david/.bin/julia-1.6.0/share/julia/stdlib/v1.6/NetworkOptions
deac9b47-8bc7-5906-a0fe-35ac56dc84c0 LibCURL_jll /home/david/.bin/julia-1.6.0/share/julia/stdlib/v1.6/LibCURL_jll
bd369af6-aec1-5ad0-b16a-f7cc5008161c Tables /home/david/.julia/packages/Tables/UxLRG
...

```

More info here: [12. API Reference · Pkg.jl](https://pkgdocs.julialang.org/v1.5/api/#Pkg.dependencies)

Curious as to what analysis you are doing, if you can share 😁

---

<div class="post-metadata">

### Author: ![danielmatz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielmatz/32/2285_2.png) [@danielmatz](https://discourse.julialang.org/u/danielmatz)
#### Post date: [April 6, 2021, 7:11pm UTC](https://discourse.julialang.org/t/how-to-get-the-directory-of-an-indirect-dependency/58708/3 "2021-04-06T19:11:10Z")

</div>

I wanted to write a script to summarize the licenses of all of the dependencies, by looking for a `LICENSE` file in each package directory. I think your solution will do the trick, thanks!

---

<div class="post-metadata">

### Author: ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)
#### Post date: [April 7, 2021, 12:49am UTC](https://discourse.julialang.org/t/how-to-get-the-directory-of-an-indirect-dependency/58708/4 "2021-04-07T00:49:55Z")

</div>

[https://github.com/ericphanson/LicenseCheck.jl](https://github.com/ericphanson/LicenseCheck.jl) and [https://github.com/JuliaEcosystem/PkgDeps.jl](https://github.com/JuliaEcosystem/PkgDeps.jl) might be useful for that task (and maybe [https://github.com/JuliaEcosystem/PackageAnalyzer.jl](https://github.com/JuliaEcosystem/PackageAnalyzer.jl) too).
