# Using pmap within a package

**URL:** <https://discourse.julialang.org/t/using-pmap-within-a-package/131627>\
**Category:** General Usage\
**Tags:** distributed, pmap\
**Created:** [August 15, 2025, 1:25pm UTC](https://discourse.julialang.org/t/using-pmap-within-a-package/131627 "2025-08-15T13:25:34Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [August 15, 2025, 4:49pm UTC](https://discourse.julialang.org/t/using-pmap-within-a-package/131627/4 "2025-08-15T16:49:57Z")

</div>

It is quite tricky and annoying to use Distributed.jl in packages. This post could help: [Distributed computing for functions in scripts inside a local module? - #5 by dave.f.kleinschmidt](https://discourse.julialang.org/t/distributed-computing-for-functions-in-scripts-inside-a-local-module/96729/5) and here is a package that does use Distributed: [GitHub - beacon-biosignals/OndaBatches.jl: Local and distributed batch loading for Onda datasets](https://github.com/beacon-biosignals/OndaBatches.jl). When Distributed creates workers it does not activate the same Julia environment so they don’t have access to the source code; `remotecall_eval` is one way to activate the environment and load the right code. Instead of `include`ing code on the workers you should activate the package and load it with `using`.

---

_[View the full topic](https://discourse.julialang.org/t/using-pmap-within-a-package/131627)._
