# Loading modules on remote processes from within a function

**URL:** <https://discourse.julialang.org/t/loading-modules-on-remote-processes-from-within-a-function/43074>\
**Category:** General Usage\
**Created:** [July 14, 2020, 6:15pm UTC](https://discourse.julialang.org/t/loading-modules-on-remote-processes-from-within-a-function/43074 "2020-07-14T18:15:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![atteson](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@atteson](https://discourse.julialang.org/u/atteson)\
**Post date:** [July 14, 2020, 6:15pm UTC](https://discourse.julialang.org/t/loading-modules-on-remote-processes-from-within-a-function/43074/1 "2020-07-14T18:15:27Z")

</div>

How can I load modules on remote processes from within a function in process 1. In other words, I’m looking to do something like this:

```julia
addprocs(3)

function load()
  @everywhere using Distributions
end

load()

```

---

<div class="post-metadata">

**Author:** ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Post date:** [July 14, 2020, 7:50pm UTC](https://discourse.julialang.org/t/loading-modules-on-remote-processes-from-within-a-function/43074/3 "2020-07-14T19:50:25Z")

</div>

I think that what is often used is either:

Calling this outside of any method.

```julia
@everywhere using Distributions

```

Calling this inside or outside a method.

```julia
@everywhere include("file_with_code_loading_packages.jl")

```
