# Load only packages from the current environment

**URL:** <https://discourse.julialang.org/t/load-only-packages-from-the-current-environment/18823>\
**Category:** General Usage\
**Tags:** pkg\
**Created:** [December 19, 2018, 10:13am UTC](https://discourse.julialang.org/t/load-only-packages-from-the-current-environment/18823 "2018-12-19T10:13:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [December 19, 2018, 10:13am UTC](https://discourse.julialang.org/t/load-only-packages-from-the-current-environment/18823/1 "2018-12-19T10:13:04Z")

</div>

Assume I have a package `X` in the default environment `v1.0`. Now I switch to a custom environment, e.g. `activate whatever`. By default, `using X` will work despite the fact that I never added `X` to `whatever`, because (AFAIU) the package manager will check all `DEPOT_PATH` paths, which includes `v1.0`, where `X` will be found.

Is there a way, except just modifying the DEPOT\_PATH, to tell Julia to be more strict and only look for packages in the current environment?

---

<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:** [December 19, 2018, 10:41am UTC](https://discourse.julialang.org/t/load-only-packages-from-the-current-environment/18823/2 "2018-12-19T10:41:52Z")

</div>

> [@carstenbauer](#):
>
> By default, `using X` will work despite the fact that I never added `X` to `whatever` , because (AFAIU) the package manager will check all `DEPOT_PATH` paths, which includes `v1.0` , where `X` will be found.

The package manager is not involved in calls to `using`, and I think you mean `LOAD_PATH` instead of `DEPOT_PATH`. The load path decides what you can `using`, and what `X` means in `using X`, but when the given package has been determined, julia will look for the installation of that package in all `DEPOT_PATH`s.

You can modify the load path to include only your home project/active project as follows:

```julia
$ export JULIA_LOAD_PATH=@
$ julia -E 'Base.load_path()'
String[] # Can't load anything.
$ julia --project=. -E 'Base.load_path()'
["/home/fredrik/Project.toml"] # Can only load whats in this Project.toml file.

```
