# Development package dependencies

**URL:** https://discourse.julialang.org/t/development-package-dependencies/109557
**Category:** New to Julia
**Tags:** package, development
**Created:** [February 1, 2024, 9:21am UTC](https://discourse.julialang.org/t/development-package-dependencies/109557 "2024-02-01T09:21:10Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![JoseKling](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@JoseKling](https://discourse.julialang.org/u/JoseKling)
#### Post date: [February 1, 2024, 9:21am UTC](https://discourse.julialang.org/t/development-package-dependencies/109557/1 "2024-02-01T09:21:10Z")

</div>

Hello all,

I am currently developing a package, we can call it A, that depends on a second package B, which is also under development.  
In package A’s environment I ran `]dev B` to add B as a dependency of A. After that B is listed in the Project.toml file of package A.  
I switched to the standard environment, where I wanted to use package A, so I ran `] dev A` without problems. But when I tried `using A`, I got the error  
“LoadError: ArgumentError: Package A does not have B in its dependencies:”  
I then tried to run `] resolve`, `] instantiate`, `] update` on both packages and also `] dev B` again in package A’s environment.  
`using A` also does not work on package A’s environment.  
What am I doing wrong? Is it because of the indirect dependency on a dev package?

Thank you

---

<div class="post-metadata">

### Author: ![GHTaarn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ghtaarn/32/216007_2.png) [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)
#### Post date: [February 1, 2024, 10:14am UTC](https://discourse.julialang.org/t/development-package-dependencies/109557/2 "2024-02-01T10:14:47Z")

</div>

It works for me (and it should work)

> [@JoseKling](#):
>
> I switched to the standard environment, where I wanted to use package A, so I ran `] dev A` without problems.

when you say you ran `] dev A` did you supply the full path to package `A`? e.g.

```julia
] dev /home/john/mypackages/A

```

---

<div class="post-metadata">

### Author: ![JoseKling](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@JoseKling](https://discourse.julialang.org/u/JoseKling)
#### Post date: [February 1, 2024, 10:25am UTC](https://discourse.julialang.org/t/development-package-dependencies/109557/3 "2024-02-01T10:25:49Z")

</div>

No, but I just tried it and it makes no difference. Both ways add the same thing and do not solve the problem…

---

<div class="post-metadata">

### Author: ![GHTaarn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ghtaarn/32/216007_2.png) [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)
#### Post date: [February 1, 2024, 10:39am UTC](https://discourse.julialang.org/t/development-package-dependencies/109557/4 "2024-02-01T10:39:24Z")

</div>

Try to create a minimum example that exhibits the problem and show some more detail on exactly what you did. e.g something starting with (in Julia pkg mode):

```julia
generate A
generate B
activate ./A
dev ./B

```

Hereafter, insert the line `using B` immediately before the line `greet() = println("Hello World!")` in the file `./A/src/A.jl`.

Hereafter in Julia mode execute:

```julia
import Pkg
Pkg.activate()
Pkg.develop(path="./A")
using A

```

---

<div class="post-metadata">

### Author: ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)
#### Post date: [February 1, 2024, 10:48am UTC](https://discourse.julialang.org/t/development-package-dependencies/109557/5 "2024-02-01T10:48:12Z")

</div>

I always create a global environment with all packages of the project dev’ed (notice the `@` prefix in the env name):

```julia
] activate @mydev
] dev A
] dev B

```

Whenever you need to develop the project as a whole, you can activate this environment:

```julia
] activate @mydev

```

---

<div class="post-metadata">

### Author: ![JoseKling](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@JoseKling](https://discourse.julialang.org/u/JoseKling)
#### Post date: [February 1, 2024, 11:01am UTC](https://discourse.julialang.org/t/development-package-dependencies/109557/6 "2024-02-01T11:01:40Z")

</div>

I had package B, which is working fine.  
For package A, I created it with PkgTemplates (package B was also originally created like this).

```julia
using PkgTemplates
t = Template(;
           user="MyName",
           authors=["My Name"],
           plugins=[
               License(name="MIT"),
               Git(),
               GitHubActions(),
           ],
       )
t("A")

```

In the file A.jl I included the line  
`using B`  
Then, in Julia Pkg mode, I ran

```julia
activate A 
dev B

```

Which ran successfully and added package B to its Project.toml file. Lastly I tried in the REPL  
`using A`  
which returned the error.  
I then tried what I described, like resolve, instantiate, using the full path of the packages.  
One thing I just noticed is that B’s Project.toml file has the fields ‘name’, ‘uuid’, ‘authors’ and ‘version’ in the beginning of the file, before the dependencies. These are missing in A’s Project.toml file.

---

<div class="post-metadata">

### Author: ![GHTaarn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ghtaarn/32/216007_2.png) [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)
#### Post date: [February 1, 2024, 11:13am UTC](https://discourse.julialang.org/t/development-package-dependencies/109557/7 "2024-02-01T11:13:37Z")

</div>

> [@JoseKling](#):
>
> One thing I just noticed is that B’s Project.toml file has the fields ‘name’, ‘uuid’, ‘authors’ and ‘version’ in the beginning of the file, before the dependencies. These are missing in A’s Project.toml file.

That sounds suspicious. I updated my previous post to be a full minimal example, try to follow it and see if you still get the problem.

---

<div class="post-metadata">

### Author: ![JoseKling](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@JoseKling](https://discourse.julialang.org/u/JoseKling)
#### Post date: [February 1, 2024, 11:44am UTC](https://discourse.julialang.org/t/development-package-dependencies/109557/8 "2024-02-01T11:44:51Z")

</div>

I got it to work.  
I thought I was working on `.julia/dev`, but now I noticed that my working directory was actually `.julia/dev/A` and there was a folder called A inside it with a `Project.toml` and `Manifest.toml` files. For some reason the dependencies were added to these files, but not to the correct ones. So when I tried using package A, there were no dependencies listed.  
Anyway, I am still confused how exactly this happened, but it is working.  
Thanks a lot for the help. Really appreciate it!
