# Run another Julia with the same Pkg environment?

**URL:** https://discourse.julialang.org/t/run-another-julia-with-the-same-pkg-environment/13668
**Category:** General Usage
**Created:** [August 18, 2018, 4:24pm UTC](https://discourse.julialang.org/t/run-another-julia-with-the-same-pkg-environment/13668 "2018-08-18T16:24:19Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jonathanBieler](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)
#### Post date: [August 18, 2018, 4:24pm UTC](https://discourse.julialang.org/t/run-another-julia-with-the-same-pkg-environment/13668/1 "2018-08-18T16:24:20Z")

</div>

In my tests I run a script in another Julia `run("julia myscript.jl")` and my script starts with `using Distributions` which gives me a :

```
ERROR: LoadError: ArgumentError: Module Distributions not found in current path.

```

How can I make sure that my second Julia process uses the same environment as the main one ?

Thanks.

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [August 18, 2018, 5:59pm UTC](https://discourse.julialang.org/t/run-another-julia-with-the-same-pkg-environment/13668/2 "2018-08-18T17:59:08Z")

</div>

Start it in the same directory? If you use 0.7 or 1.0.

---

<div class="post-metadata">

### Author: ![jonathanBieler](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)
#### Post date: [August 18, 2018, 6:35pm UTC](https://discourse.julialang.org/t/run-another-julia-with-the-same-pkg-environment/13668/3 "2018-08-18T18:35:18Z")

</div>

I think the issue was that my `julia` was referring to another version (I have like 5 installed). Otherwise I guess you could pass the path as an argument and activate it in the script.

---

<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: [August 18, 2018, 7:48pm UTC](https://discourse.julialang.org/t/run-another-julia-with-the-same-pkg-environment/13668/4 "2018-08-18T19:48:01Z")

</div>

> [@jonathanBieler](#):
>
> I think the issue was that my `julia` was referring to another version (I have like 5 installed).

You can use `Base.julia_cmd()` to spawn the same version.
