# How to activate the current project with Distributed

**URL:** <https://discourse.julialang.org/t/how-to-activate-the-current-project-with-distributed/101965>\
**Category:** General Usage\
**Tags:** question, package, distributed\
**Created:** [July 23, 2023, 3:52pm UTC](https://discourse.julialang.org/t/how-to-activate-the-current-project-with-distributed/101965 "2023-07-23T15:52:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [July 23, 2023, 3:52pm UTC](https://discourse.julialang.org/t/how-to-activate-the-current-project-with-distributed/101965/1 "2023-07-23T15:52:39Z")

</div>

I am trying to activate the current project with Distributed, which fails:

```julia
using Distributed

@everywhere begin
  cd("..")
  using Pkg; Pkg.activate(@ __DIR__ )
  Pkg.instantiate(); Pkg.precompile()
  Pkg.status()
end

```

Output:

```julia
julia> include("src/dist.jl")
  Activating project at `~/repos/WindTurbines/src`
      From worker 7: Activating project at `~/repos/WindTurbines/src`

```

It tries to find Project.toml in the folder src, but it is in the base folder.

How can I fix that?

---

<div class="post-metadata">

**Author:** ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Post date:** [July 23, 2023, 4:19pm UTC](https://discourse.julialang.org/t/how-to-activate-the-current-project-with-distributed/101965/2 "2023-07-23T16:19:10Z")

</div>

> [@ufechner7](#):
>
> `using Pkg; Pkg.activate(@ __DIR__ )`

If your source file is `src/dist.jl`, then within it `@ __DIR__ == "/path/to/project/src"`. So you have to go up one directory to retrieve the top-level project directory:

```julia
@everywhere begin
    import Pkg
    Pkg.activate(joinpath(@ __DIR__ , ".."))
end

```

  

If your julia depot is on a shared filesystem, I would also recommend to take the appropriate steps for the project to be compiled on one node beforehand, so that when starting the distributed computations everything is already done. Last time I checked, problems could arise if several processes attempted to precompile the same set of packages at the same time.
