# Activate project in multiple cores when running script from command line

**URL:** https://discourse.julialang.org/t/activate-project-in-multiple-cores-when-running-script-from-command-line/47074
**Category:** General Usage
**Tags:** question, distributed
**Created:** [September 22, 2020, 2:32pm UTC](https://discourse.julialang.org/t/activate-project-in-multiple-cores-when-running-script-from-command-line/47074 "2020-09-22T14:32:16Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![AAL](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aal/32/9242_2.png) [@AAL](https://discourse.julialang.org/u/AAL)
#### Post date: [September 22, 2020, 2:32pm UTC](https://discourse.julialang.org/t/activate-project-in-multiple-cores-when-running-script-from-command-line/47074/1 "2020-09-22T14:32:16Z")

</div>

I have a project folder with a package that can make computations in parallel processes and a script that makes use of the package. Because I want my script to run in parallel I need to load the package in all process, so `script.jl` starts like this

```julia
using Distributed
@everywhere using MyPackage

```

However, `MyPackage` is not in the load path, so I need to activate its environment in all cores first. I would like to be able to run the script from the command line in the appropriate environment, so I was expecting this would work:

```julia
shell> julia -p auto --project=. script.jl

```

However, I get the error that worker 2 could not find the package, so I assume the project is only activated in the main process (`shell> julia --project=. script.jl` does not throw any errors). Is there a way to activate the project on all cores from the command line?  
I am getting around this issue by modifying the script to activate the environment in all cores but I do not like to have my script be dependent on the working directory:

```julia
using Distributed
@everywhere using Pkg
@everywhere Pkg.activate(".")
@everywhere using MyPackage

```

Any advice on best practices would be much appreciated.
