# Is the flag --project expected to activate/instantiate?

**URL:** https://discourse.julialang.org/t/is-the-flag-project-expected-to-activate-instantiate/115265
**Category:** General Usage
**Created:** [June 6, 2024, 3:09am UTC](https://discourse.julialang.org/t/is-the-flag-project-expected-to-activate-instantiate/115265 "2024-06-06T03:09:39Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)
#### Post date: [June 6, 2024, 3:09am UTC](https://discourse.julialang.org/t/is-the-flag-project-expected-to-activate-instantiate/115265/1 "2024-06-06T03:09:39Z")

</div>

I run julia as `julia --project=.`, and I get  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/5/4/54844812f8b00d32eabb8a14b414105ffbdd49cd.png)  
So it looks like just using this command line flag did not cause activate/instantiate to run. Is that expected?

---

<div class="post-metadata">

### Author: ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)
#### Post date: [June 6, 2024, 3:27am UTC](https://discourse.julialang.org/t/is-the-flag-project-expected-to-activate-instantiate/115265/2 "2024-06-06T03:27:19Z")

</div>

`activate` and `instantiate` are two separate operations.

Doing `julia --project=/foo/bar` is roughly equivalent to starting Julia with `julia` and then doing `import Pkg; Pkg.activate("/foo/bar")`.

Starting Julia with `julia --project=/foo/bar` does not do an `instantiate`; you need to do the `import Pkg; Pkg.instantiate()` yourself. This is the expected behavior.

---

<div class="post-metadata">

### Author: ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)
#### Post date: [June 6, 2024, 11:47pm UTC](https://discourse.julialang.org/t/is-the-flag-project-expected-to-activate-instantiate/115265/3 "2024-06-06T23:47:57Z")

</div>

So it is not possible to do both with a single command line flag? I think that is a missed opportunity. Usually when I have a freshly downloaded project, it will require both, as far as I understand? So then I have to start julia and do “using package, package activate, package update”?

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [June 7, 2024, 12:35am UTC](https://discourse.julialang.org/t/is-the-flag-project-expected-to-activate-instantiate/115265/4 "2024-06-07T00:35:46Z")

</div>

You can do `julia --project` and then `] up`. So a little bit simpler.

(if you are in the directory there’s no need for the `="."` in `--project="."`)

You could also create a shortcut for:

```julia
% julia --project -i -e "import Pkg; Pkg.update()"

```

if you need that very often.

---

<div class="post-metadata">

### Author: ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)
#### Post date: [June 7, 2024, 12:45am UTC](https://discourse.julialang.org/t/is-the-flag-project-expected-to-activate-instantiate/115265/5 "2024-06-07T00:45:47Z")

</div>

> [@PetrKryslUCSD](#):
>
> So then I have to start julia and do

If you are working interactively at the REPL, you can make these instructions a bit more concise by using the Pkg REPL mode.

So you’d have two options.

Option 1: Start Julia with `julia --project` and do the following:

```julia
] instantiate

```

Option 2: Start Julia with `julia` and do the following:

```julia
] activate .
] instantiate

```

---

<div class="post-metadata">

### Author: ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)
#### Post date: [June 7, 2024, 12:48am UTC](https://discourse.julialang.org/t/is-the-flag-project-expected-to-activate-instantiate/115265/6 "2024-06-07T00:48:31Z")

</div>

I think the ship has probably sailed on changing the behavior of `julia --project=/foo/bat`.

If we really want to have a way of doing the instantiating with a command-line flag, we could add a new command-line flag named `--instantiate`.

And then `julia --project=/foo-bar --instantiate` would be equivalent to starting Julia with `julia --project=/foo/bar` and then doing `import Pkg; Pkg.instantiate()`.

I’m not sure if this saves a whole lot of time (or typing).

---

<div class="post-metadata">

### Author: ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)
#### Post date: [June 7, 2024, 12:50am UTC](https://discourse.julialang.org/t/is-the-flag-project-expected-to-activate-instantiate/115265/7 "2024-06-07T00:50:42Z")

</div>

Also, note that `Pkg.instantiate()` and `Pkg.update()` are two very different operations. If you’ve just cloned a fresh Julia project that includes a `Manifest.toml`, and you want to instantiate the same environment as the author of that project, then you want to do `Pkg.instantiate()`.

`Pkg.update()` may modify the manifest, and thus you won’t have the same setup as the author of the project.

---

<div class="post-metadata">

### Author: ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)
#### Post date: [June 7, 2024, 1:44pm UTC](https://discourse.julialang.org/t/is-the-flag-project-expected-to-activate-instantiate/115265/8 "2024-06-07T13:44:25Z")

</div>

In this thread I am thinking of running on HPC via SLURM.
