# How to import JSON when using parallel mode?

**URL:** <https://discourse.julialang.org/t/how-to-import-json-when-using-parallel-mode/17513>\
**Category:** New to Julia\
**Created:** [November 14, 2018, 12:35pm UTC](https://discourse.julialang.org/t/how-to-import-json-when-using-parallel-mode/17513 "2018-11-14T12:35:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cenwangumass](https://avatars.discourse-cdn.com/v4/letter/c/bb73d2/32.png) [@cenwangumass](https://discourse.julialang.org/u/cenwangumass)\
**Post date:** [November 14, 2018, 12:35pm UTC](https://discourse.julialang.org/t/how-to-import-json-when-using-parallel-mode/17513/1 "2018-11-14T12:35:05Z")

</div>

Hi,

I’d like to parallelize my program so I start my program with

```julia
julia --project -p 2 -L a.jl main.jl

```

where the computation is in `a.jl` and `main.jl` is a driver script. Inside `a.jl` I `import JSON`, and if I don’t add the `-p 2` argument the program will run fine, but with this option, I now have the error:

```julia
ERROR: On worker 2:
LoadError: ArgumentError: Package JSON not found in current path:
- Run `import Pkg; Pkg.add("JSON")` to install the JSON package.

```

It seems like I’m missing something, like instruct the workers to also include the libraries. What should I do in this case?

Thanks!

---

<div class="post-metadata">

**Author:** ![adamslc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adamslc/32/3452_2.png) [@adamslc](https://discourse.julialang.org/u/adamslc)\
**Post date:** [November 14, 2018, 4:22pm UTC](https://discourse.julialang.org/t/how-to-import-json-when-using-parallel-mode/17513/3 "2018-11-14T16:22:14Z")

</div>

You need to tell the worker processes to also use the local project like this:

```julia
import Pkg; Pkg.activate(".")
using JSON

```

In the future, it would be great if worker processes automatically adopted the project of the main process.
