# The way to deploy the user-defined package

**URL:** <https://discourse.julialang.org/t/the-way-to-deploy-the-user-defined-package/28986>\
**Category:** General Usage\
**Created:** [September 20, 2019, 7:53am UTC](https://discourse.julialang.org/t/the-way-to-deploy-the-user-defined-package/28986 "2019-09-20T07:53:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhangliye](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zhangliye/32/3208_2.png) [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Post date:** [September 20, 2019, 7:53am UTC](https://discourse.julialang.org/t/the-way-to-deploy-the-user-defined-package/28986/1 "2019-09-20T07:53:08Z")

</div>

I have created two packages created as follows.  
(1) Create PackageA  
step1: generate PackageA  
step2: add code  
step3: cd PackageA  
dev . # deploy PackageA  
(2) Create PackageB depending on PackageA  
step1: generate PackageB  
step2: add code  
step3: cd PackageB  
dev . # deploy PackageB

step4: activate .  
step5: add PackageA #error in this line as follows

`ERROR: The following package names could not be resolved: PackageA (not found in project or manifest) Please specify by known `name=uuid`.`

The command,  
`Pkg> st `  
can show the PackageA and PackageB.  
Also, i can run “using PackageA”

Is this the right way to deploy the user-defined package, which depending on another one?  
Thanks

---

<div class="post-metadata">

**Author:** ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Post date:** [September 20, 2019, 1:04pm UTC](https://discourse.julialang.org/t/the-way-to-deploy-the-user-defined-package/28986/2 "2019-09-20T13:04:48Z")

</div>

You need to `add` or better `dev` `PackageA` while `PackageB`’s environment is active.

You need to use the local path to `PackageA` when issuing the `dev`.

The syntax depends on whether you do `>pkg dev` or `Pkg.develop`.

`>pkg dev /path/to/PackageB` is one option.

I think it would be easiest if you look up the details [here](https://lhendricks.org/julia_notes.pdf).

---

<div class="post-metadata">

**Author:** ![zhangliye](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zhangliye/32/3208_2.png) [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Post date:** [September 21, 2019, 1:41am UTC](https://discourse.julialang.org/t/the-way-to-deploy-the-user-defined-package/28986/3 "2019-09-21T01:41:04Z")

</div>

Thanks! It works. I add the relative path to the command

I first edit the Manifest.toml and Project.toml and add dependency information of PackageA  
Then, run  
PackageB\> instantiate

The following step update the manually added contents in Manifest.toml, add more information  
PackageB\> add PackageA …/PackageA #without the first two steps, this can not run;  
In the Manifest.toml, it use the relative path and works.

The notes you suggested is very helpful. Thanks!

---

<div class="post-metadata">

**Author:** ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Post date:** [September 21, 2019, 2:35pm UTC](https://discourse.julialang.org/t/the-way-to-deploy-the-user-defined-package/28986/4 "2019-09-21T14:35:44Z")

</div>

Perhaps I misunderstand what you wrote, but _do not hand-edit Project.toml or Manifest.toml_.

The only thing you should have to do is

1. activate PackageB
2. `>pkg dev /path/to/PackageA`

Everything else is automatic. There is no need to `instantiate` anything (at least assuming your code is already in `JULIA_PKG_DEVDIR` (~/.julia/dev by default); it should be).

I don’t really understand your second to last paragraph about `PackageB> add` etc.

---

<div class="post-metadata">

**Author:** ![zhangliye](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zhangliye/32/3208_2.png) [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Post date:** [September 21, 2019, 7:36pm UTC](https://discourse.julialang.org/t/the-way-to-deploy-the-user-defined-package/28986/5 "2019-09-21T19:36:27Z")

</div>

Thanks for your suggestion. I created two packages PackageA and PackageB, which is not a git directory. PakcageB depends on PackageA. I want to install PackageA and PackageB. I solve this by edit Manifest.toml and Project.toml according to [the notes](https://lhendricks.org/julia_notes.pdf). It works well. Thanks!
