# Add package on remote worker

**URL:** <https://discourse.julialang.org/t/add-package-on-remote-worker/75489>\
**Category:** Julia at Scale\
**Created:** [January 31, 2022, 5:58am UTC](https://discourse.julialang.org/t/add-package-on-remote-worker/75489 "2022-01-31T05:58:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![guyvdb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/guyvdb/32/11596_2.png) [@guyvdb](https://discourse.julialang.org/u/guyvdb)\
**Post date:** [January 31, 2022, 5:58am UTC](https://discourse.julialang.org/t/add-package-on-remote-worker/75489/1 "2022-01-31T05:58:35Z")

</div>

I am trying to install packages on a `Distributed` worker, but get errors during precompilation that don’t occur when running the same commands on the server manually.

```julia
using Distributed
pids = addprocs(["server.edu"])
remotecall_wait(pids[1]) do
    @eval using Pkg
    Pkg.activate("/tmp/temp_project")
    Pkg.instantiate()
    Pkg.add("CUDA") 
end        

```

```julia
...From worker 2: 5 dependencies errored....

```

More generally, how can I use `Distributed` without (1) having a shared filesystem or (2) manually setting up project environments on all servers over SSH in some external script?

---

<div class="post-metadata">

**Author:** ![albheim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albheim/32/34660_2.png) [@albheim](https://discourse.julialang.org/u/albheim)\
**Post date:** [January 31, 2022, 6:50am UTC](https://discourse.julialang.org/t/add-package-on-remote-worker/75489/2 "2022-01-31T06:50:27Z")

</div>

[DistributedEnvironments.jl](https://github.com/albheim/DistributedEnvironments.jl) was put together for helping with this. It takes a look at the currently active local environment and reproduces that on each machine you give it and sets them up as workers.
