# Handling various types of dependencies

**URL:** <https://discourse.julialang.org/t/handling-various-types-of-dependencies/27850>\
**Category:** General Usage\
**Created:** [August 22, 2019, 2:45pm UTC](https://discourse.julialang.org/t/handling-various-types-of-dependencies/27850 "2019-08-22T14:45:38Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Post date:** [August 23, 2019, 9:19am UTC](https://discourse.julialang.org/t/handling-various-types-of-dependencies/27850/6 "2019-08-23T09:19:58Z")

</div>

> [@Tamas\_Papp](#):
>
> My understanding is that this is what [stacked environments](https://docs.julialang.org/en/v1/manual/code-loading/#Environments-1) are for

Good idea!

Indeed, stacking the “superproject” environment with the environment defined by a “subproject” would probably be ideal.

> [@Tamas\_Papp](#):
>
> I do not know how to use them in practice.

I don’t either. Maybe we lack some tooling and/or documentation in this area.

Here is an attempt fiddling with `LOAD_PATH`. The following tests are run in a directory with the following files:

```julia
.
├── Manifest.toml
├── Project.toml -> deps: LinearAlgebra
└── SubProject
    ├── Manifest.toml
    └── Project.toml -> deps: BenchmarkTools

```

```julia
shell> julia --project --quiet

# Restrict LOAD_PATH so that we don't have access to the home environment
julia> splice!(LOAD_PATH, 1:length(LOAD_PATH)); push!(LOAD_PATH, "@")
1-element Array{String,1}:
 "@"

# BenchmarkTools is not defined as a dependency of the top-level project
julia> using BenchmarkTools
ERROR: ArgumentError: Package BenchmarkTools not found in current path:
- Run `import Pkg; Pkg.add("BenchmarkTools")` to install the BenchmarkTools package.

Stacktrace:
 [1] require(::Module, ::Symbol) at ./loading.jl:823

# However it is a dependency of the SubProject
julia> push!(LOAD_PATH, "SubProject")
2-element Array{String,1}:
 "@"         
 "SubProject"

julia> using BenchmarkTools

julia> 

```

---

_[View the full topic](https://discourse.julialang.org/t/handling-various-types-of-dependencies/27850)._
