# Creating empty isolated environment

**URL:** https://discourse.julialang.org/t/creating-empty-isolated-environment/22183
**Category:** New to Julia
**Tags:** pkg, environment
**Created:** [March 22, 2019, 7:39am UTC](https://discourse.julialang.org/t/creating-empty-isolated-environment/22183 "2019-03-22T07:39:46Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)
#### Post date: [March 22, 2019, 7:39am UTC](https://discourse.julialang.org/t/creating-empty-isolated-environment/22183/1 "2019-03-22T07:39:46Z")

</div>

I try to create a clean Pkg environment, completely independent from my “normal” default one with packages, and cannot get it right:

```julia
➜ mkdir tmp
➜ cd tmp
➜ julia --startup-file=no
(v1.1) pkg> activate .

(tmp) pkg> status
    Status `~/julia/tmp/Project.toml`
  (empty environment)

julia> using <TAB>
AverageShiftedHistograms DifferentialEquations ImageFiltering Logging Pkg Revise SuiteSparse
AxisArrays Distributed Interact LsqFit Plots SHA TensorCast
Base Distributions InteractiveUtils MLStyle Polychord Serialization Test
Base64 FFTW Interpolations MacroTools PooledArrays Setfield TimerOutputs
BenchmarkTools FINUFFT IterTools Markdown Printf SharedArrays Traceur
CRC32c FITSIO JLD2 Match Profile ShiftedArrays Turing
CSV FTPClient JuMP Measurements ProfileView Sockets UUIDs
Conda FastTransforms JuliennedArrays Mmap ProgressMeter SparseArrays UnalignedVectors
Core FieldMetadata Keys NFFT PyCall SpecialFunctions Unicode
DataFrames FileIO LaTeXStrings NLopt PyPlot SplitApplyCombine UnicodePlots
DataStreams FileWatching LibGit2 NaNMath Query StatPlots Unitful
DataStructures Flatten LibPQ NamedTupleTools QueryOperators StatProfilerHTML UnitfulAngles
DataValues Future Libdl Pandas REPL StaticArrays UnitfulAstro
Dates Glob LinearAlgebra Parameters Random Statistics VegaLite
DelimitedFiles IJulia LocalFilters PhysicalConstants ResumableFunctions StatsBase WebIO

```

As you see, `status` shows that there are indeed no packages installed in this new empty environment, however I still can import packages installed in my default environment with `using`, and they work. Shouldn’t I get a clear environment in this case by design?

---

<div class="post-metadata">

### Author: ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)
#### Post date: [March 22, 2019, 7:42am UTC](https://discourse.julialang.org/t/creating-empty-isolated-environment/22183/2 "2019-03-22T07:42:15Z")

</div>

I think you need to set the `LOAD_PATH`. See also [How to install packages which are needed only for development](https://discourse.julialang.org/t/how-to-install-packages-which-are-needed-only-for-development/21815)

---

<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: [March 22, 2019, 8:08am UTC](https://discourse.julialang.org/t/creating-empty-isolated-environment/22183/3 "2019-03-22T08:08:25Z")

</div>

> [@mauro3](#):
>
> I think you need to set the `LOAD_PATH` .

Yes. Assuming you have the default `LOAD_PATH` in the example above you have the following stack:

```julia
[
@, # for active project
@v#.#, # global environment for the current julia version
@stdlib # Julias standard library
]

```

What you want in this example is probably just

```julia
[
@, # for active project
]

```

which you can achieve by modifying load path, e.g.

```julia
export JULIA_LOAD_PATH=@

```

---

<div class="post-metadata">

### Author: ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)
#### Post date: [March 22, 2019, 9:09am UTC](https://discourse.julialang.org/t/creating-empty-isolated-environment/22183/4 "2019-03-22T09:09:14Z")

</div>

Thank you, this works! I guess `Pkg` docs was the wrong place for me to look for this particular thing.  
And how do I set `LOAD_PATH` without env variables, that is from inside julia? Do I really have to delete elements which are not “@” one by one, as it seems impossible to assign the whole array?

---

<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: [March 22, 2019, 9:14am UTC](https://discourse.julialang.org/t/creating-empty-isolated-environment/22183/5 "2019-03-22T09:14:48Z")

</div>

It would be good to document those things in the Pkg manual too. Do you want to contribute with that?

> [@aplavin](#):
>
> And how do I set `LOAD_PATH` without env variables, that is from inside julia? Do I really have to delete elements which are not “@” one by one, as it seems impossible to assign the whole array?

You can do e.g. this:

```julia-auto
empty!(LOAD_PATH)
push!(LOAD_PATH, "@")

```
