# 0.7 Pkg: how to make projects aware of each other

**URL:** <https://discourse.julialang.org/t/0-7-pkg-how-to-make-projects-aware-of-each-other/11372>\
**Category:** General Usage\
**Created:** [June 2, 2018, 5:48pm UTC](https://discourse.julialang.org/t/0-7-pkg-how-to-make-projects-aware-of-each-other/11372 "2018-06-02T17:48:33Z")\
**Posts on this page:** 11\
**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 2, 2018, 5:48pm UTC](https://discourse.julialang.org/t/0-7-pkg-how-to-make-projects-aware-of-each-other/11372/1 "2018-06-02T17:48:33Z")

</div>

Pkg for 0.7-alpha: There is some discussion in the documentation how to add packages using git. The problem is, at the moment this doesn’t work on Windows 10 (some system-level bug).

So how do I set up two projects in my working folder and then make them aware of each other. Let us say I set up project `A` and `B` (with `Pkg` command `generate`). Then I want to work in the directory `B` and do `using A`. How do I make Julia aware of the location of these two projects? The documentation is at the moment silent on this topic.

Thanks.

---

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [June 2, 2018, 8:02pm UTC](https://discourse.julialang.org/t/0-7-pkg-how-to-make-projects-aware-of-each-other/11372/2 "2018-06-02T20:02:55Z")

</div>

One way or another each project needs to have its dependencies to its `Project.toml` in order to work (at, least, this is my current understanding). Are you saying that if you do `add PackageName` this fails because of a git error on Windows? If that’s the case I _think_ you can at least move your packages into `.julia/dev` and then do `develop PackageName` on each package. It will still try to talk to git and fail, but if it successfully adds the packages to the environment it’ll still work because it still ought to just look for them in `dev`.

---

<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 2, 2018, 8:21pm UTC](https://discourse.julialang.org/t/0-7-pkg-how-to-make-projects-aware-of-each-other/11372/3 "2018-06-02T20:21:58Z")

</div>

What fails is to do  
`add https://github.com/PetrKryslUCSD/FinEtools.jl.git`

An issue has been filed. In the meantime I will try your trick with `dev`.

---

<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:** [June 3, 2018, 4:29pm UTC](https://discourse.julialang.org/t/0-7-pkg-how-to-make-projects-aware-of-each-other/11372/4 "2018-06-03T16:29:07Z")

</div>

For exampe:

```julia
➜ ~ mkdir MyProject
➜ ~ cd MyProject
➜ MyProject ~/julia/julia

(v0.7) pkg> generate A; generate B
Generating project A:
    A/Project.toml
    A/src/A.jl
Generating project B:
    B/Project.toml
    B/src/B.jl

shell> cd B
/Users/kristoffer/MyProject/B

(B) pkg> dev ../A
 Resolving package versions...
  Updating `Project.toml`
  [08b160a6] + A v0.1.0 [`~/MyProject/A`]
  Updating `Manifest.toml`
  [08b160a6] + A v0.1.0 [`~/MyProject/A`]

```

Now you can load `A` in `B`.

---

<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 3, 2018, 5:41pm UTC](https://discourse.julialang.org/t/0-7-pkg-how-to-make-projects-aware-of-each-other/11372/5 "2018-06-03T17:41:40Z")

</div>

Fantastic. I hope this example will make it into the documentation of `Pkg`!

---

<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:** [June 3, 2018, 6:03pm UTC](https://discourse.julialang.org/t/0-7-pkg-how-to-make-projects-aware-of-each-other/11372/6 "2018-06-03T18:03:38Z")

</div>

There is some docs for `dev` in the REPL mode

```julia
pkg> help dev
  develop pkg[=uuid] [#rev] ...

  Make a package available for development. If pkg is an existing local path that path will be recorded in the manifest and used.
  [...]

```

Perhaps it is not clear enough.

---

<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 3, 2018, 7:34pm UTC](https://discourse.julialang.org/t/0-7-pkg-how-to-make-projects-aware-of-each-other/11372/7 "2018-06-03T19:34:59Z")

</div>

OK, now I follow that sentence. Thanks. The example would be nice though.  
Also: does it also follow that one should be able to do `add pkg` where `pkg` is a local path?

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [June 3, 2018, 8:07pm UTC](https://discourse.julialang.org/t/0-7-pkg-how-to-make-projects-aware-of-each-other/11372/8 "2018-06-03T20:07:04Z")

</div>

If you have the location information in the manifest file(s), how can you do something like switch things from loading from a network version to a local version?  
I see in the manifest something like “[https://github.com/JuliaString/](https://github.com/JuliaString/)…”, but now want to switch all of them to load from my local directory “/s/…” instead, how can that be accomplished easily?  
(Preferably, without modifying those files back and forth)

---

<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:** [June 3, 2018, 9:27pm UTC](https://discourse.julialang.org/t/0-7-pkg-how-to-make-projects-aware-of-each-other/11372/9 "2018-06-03T21:27:06Z")

</div>

> [@ScottPJones](#):
>
> Preferably, without modifying those files back and forth)

The manifest is what tells julia what to load so that has to be modified. `dev` tells it to put a psth entry in the `free` says to take it away and start tracking the registry again.

---

<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 3, 2018, 11:43pm UTC](https://discourse.julialang.org/t/0-7-pkg-how-to-make-projects-aware-of-each-other/11372/10 "2018-06-03T23:43:07Z")

</div>

Nice, this works fine!

Why does it have to be `dev` and not `add`? I tried with `add`, but I got complaints about git…

Thanks again.

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [June 4, 2018, 12:35am UTC](https://discourse.julialang.org/t/0-7-pkg-how-to-make-projects-aware-of-each-other/11372/11 "2018-06-04T00:35:28Z")

</div>

OK, then I think it would be a useful capability to be able to switch manifests between local and remote without having to update the files themselves, not just for development.  
This is something that comes up frequently when normally you might want to pull files from github, but if you are off-line, use a local copy only.
