# Is there a short version of: \`Pkg.TOML.parse(open("Project.toml"))\["deps"\] |\> keys |\> collect .|\> Pkg.add\`?

**URL:** <https://discourse.julialang.org/t/is-there-a-short-version-of-pkg-toml-parse-open-project-toml-deps-keys-collect-pkg-add/46768>\
**Category:** General Usage\
**Created:** [September 17, 2020, 10:33am UTC](https://discourse.julialang.org/t/is-there-a-short-version-of-pkg-toml-parse-open-project-toml-deps-keys-collect-pkg-add/46768 "2020-09-17T10:33:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![arabidopsis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arabidopsis/32/26457_2.png) [@arabidopsis](https://discourse.julialang.org/u/arabidopsis)\
**Post date:** [September 17, 2020, 10:33am UTC](https://discourse.julialang.org/t/is-there-a-short-version-of-pkg-toml-parse-open-project-toml-deps-keys-collect-pkg-add/46768/1 "2020-09-17T10:33:09Z")

</div>

I was trying to add the required depedencies from a repo with a Project.toml file. I tried  
activate/update/resolve etc. They did things… except seemingly add any packages. I finally used the  
code snippet above to read the file and add the packages therein.

I’m obviously missing something.

Very confused.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [September 17, 2020, 10:36am UTC](https://discourse.julialang.org/t/is-there-a-short-version-of-pkg-toml-parse-open-project-toml-deps-keys-collect-pkg-add/46768/2 "2020-09-17T10:36:19Z")

</div>

I don’t really understand why you wold want to do this. You can just start Julia with `--project` in the repo or call `Pkg.activate(...)` with the path to the repo and then do `Pkg.instantiate()` and off you go.

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [September 17, 2020, 11:13am UTC](https://discourse.julialang.org/t/is-there-a-short-version-of-pkg-toml-parse-open-project-toml-deps-keys-collect-pkg-add/46768/3 "2020-09-17T11:13:09Z")

</div>

> [@arabidopsis](#):
>
> They did things… except seemingly add any packages

Sometimes I instantiate a project and nothing seems to happen, but it’s because I already have all of the dependencies installed (generally from another project with similar requirements). If you do `using ...` for one of the dependencies, does it work?

---

<div class="post-metadata">

**Author:** ![arabidopsis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arabidopsis/32/26457_2.png) [@arabidopsis](https://discourse.julialang.org/u/arabidopsis)\
**Post date:** [September 17, 2020, 12:00pm UTC](https://discourse.julialang.org/t/is-there-a-short-version-of-pkg-toml-parse-open-project-toml-deps-keys-collect-pkg-add/46768/4 "2020-09-17T12:00:03Z")

</div>

It’s an odd package… It’s a server written in julia and not destined for the REPL. There’s  
a supervisord service that just has basically: `/path/to/bin/julia /path/to/repo/startup.jl`.

(So it’s running in the main ~/.julia/environments/v1.5/ environment).

As I said all my attempts with the REPL package manager failed. That little snippet did the trick (I guess it _is_ using the package manger!) … but I don’t know why I couldn’t do it an “official” way.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [September 17, 2020, 12:02pm UTC](https://discourse.julialang.org/t/is-there-a-short-version-of-pkg-toml-parse-open-project-toml-deps-keys-collect-pkg-add/46768/5 "2020-09-17T12:02:50Z")

</div>

The “official” way would be something like

```julia
/path/to/bin/julia --project=/path/to/repo /path/to/repo/startup.jl

```

where the top of `startup.jl` would have

```julia
using Pkg; Pkg.instantiate()

```

alternatively:

```julia
/path/to/bin/julia --project=/path/to/repo -e 'using Pkg; Pkg.instanttiate()'
/path/to/bin/julia --project=/path/to/repo /path/to/repo/startup.jl

```

> [@arabidopsis](#):
>
> (So it’s running in the main ~/.julia/environments/v1.5/ environment).

This seem strange, why don’t you want to isolate the server environment?
