# Can't import a package on remote workers

**URL:** <https://discourse.julialang.org/t/cant-import-a-package-on-remote-workers/595>\
**Category:** General Usage\
**Tags:** question\
**Created:** [November 27, 2016, 2:25pm UTC](https://discourse.julialang.org/t/cant-import-a-package-on-remote-workers/595 "2016-11-27T14:25:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![wonjinChoi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wonjinchoi/32/11602_2.png) [@wonjinChoi](https://discourse.julialang.org/u/wonjinChoi)\
**Post date:** [November 27, 2016, 2:25pm UTC](https://discourse.julialang.org/t/cant-import-a-package-on-remote-workers/595/1 "2016-11-27T14:25:59Z")

</div>

Hi,  
I’m trying to set up remote workers in my desktop, so I can use it from my laptop.  
I could connect to remote workers by addprocs(), but I couldn’t import a package.

```julia
julia> addprocs([("wonjin@xxx.xxx.xxx", 4)], dir="C:/Users/wonjin", 
exename="C:/Users/wonjin/AppData/Local/Julia-0.5.0/bin/julia.exe", topology=:master_slave)
4-element Array{Int64,1}:
 2
 3
 4
 5

julia> using Roots
WARNING: Node state is inconsistent: node 2 failed to load cache from C:\Users\wonjin\.julia\lib\v0.5\Roots.ji. Got:
WARNING: Module Main uuid did not match cache file.
WARNING: Node state is inconsistent: node 3 failed to load cache from C:\Users\wonjin\.julia\lib\v0.5\Roots.ji. Got:
WARNING: Module Main uuid did not match cache file.
WARNING: Node state is inconsistent: node 4 failed to load cache from C:\Users\wonjin\.julia\lib\v0.5\Roots.ji. Got:
WARNING: Module Main uuid did not match cache file.
WARNING: Node state is inconsistent: node 5 failed to load cache from C:\Users\wonjin\.julia\lib\v0.5\Roots.ji. Got:
WARNING: Module Main uuid did not match cache file.
julia> remotecall_fetch(whos,2)
        From worker 2: Base 34483 KB Module
        From worker 2: Core 12682 KB Module

        From worker 2: Main 41310 KB Module
julia>

```

So, Roots was not loaded on remote workers.  
One weird thing is that I get same error after I uninstall the Roots package in remote desktop.  
I found a issue that seems related ([#16778](https://github.com/JuliaLang/julia/issues/16778)), but copying whole julia folder to remote desktop resulted in below error.  
`Target architecture mismatch. Please delete or regenerate sys.{so,dll,dylib}.`

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [November 27, 2016, 3:39pm UTC](https://discourse.julialang.org/t/cant-import-a-package-on-remote-workers/595/2 "2016-11-27T15:39:27Z")

</div>

If you are compiling julia yourself and want to run it on multiple machines with different hardware, you need to compile it with `MARCH` or `JULIA_CPU_TARGET` (see readme) that’s compatible with both machine.

---

<div class="post-metadata">

**Author:** ![wonjinChoi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wonjinchoi/32/11602_2.png) [@wonjinChoi](https://discourse.julialang.org/u/wonjinChoi)\
**Post date:** [November 28, 2016, 3:16pm UTC](https://discourse.julialang.org/t/cant-import-a-package-on-remote-workers/595/3 "2016-11-28T15:16:26Z")

</div>

I solved the problem by downloading and installing Windows executable from Julia website on my laptop and scp it to the desktop.  
I think the problem was running `include(joinpath(dirname(JULIA_HOME),"share","julia","build_sysimg.jl")); build_sysimg(force=true)`  
I saw that expression from [this blog post](http://www.juliabloggers.com/7-julia-gotchas-and-how-to-handle-them/).

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [November 28, 2016, 3:45pm UTC](https://discourse.julialang.org/t/cant-import-a-package-on-remote-workers/595/4 "2016-11-28T15:45:05Z")

</div>

That command rebuild the sysimg so it is not shared on different machines anymore.

---

<div class="post-metadata">

**Author:** ![wonjinChoi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wonjinchoi/32/11602_2.png) [@wonjinChoi](https://discourse.julialang.org/u/wonjinChoi)\
**Post date:** [November 29, 2016, 1:20am UTC](https://discourse.julialang.org/t/cant-import-a-package-on-remote-workers/595/5 "2016-11-29T01:20:17Z")

</div>

Yes, I understand that. Thanks for your comments.
