# Programmatically use dependency from alternate registry

**URL:** https://discourse.julialang.org/t/programmatically-use-dependency-from-alternate-registry/99066
**Category:** Package Management
**Created:** [May 18, 2023, 2:36pm UTC](https://discourse.julialang.org/t/programmatically-use-dependency-from-alternate-registry/99066 "2023-05-18T14:36:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![cpaniaguam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cpaniaguam/32/33747_2.png) [@cpaniaguam](https://discourse.julialang.org/u/cpaniaguam)
#### Post date: [May 18, 2023, 2:36pm UTC](https://discourse.julialang.org/t/programmatically-use-dependency-from-alternate-registry/99066/1 "2023-05-18T14:36:47Z")

</div>

I am writing a package `MyPkg` that has some dependencies from a third party registry. If I try to naively install `MyPkg` I get hit with an error of the following sort:

```julia
(@v1.9) pkg> add https://github.com/myusername/MyPkg.jl.git
     Cloning git-repo `https://github.com/myusername/MyPkg.jl.git`
    Updating git-repo `https://github.com/myusername/MyPkg.jl.git`
    Updating registry at `C:\Users\WDAGUtilityAccount\.julia\registries\General.toml`
   Resolving package versions...
ERROR: Unsatisfiable requirements detected for package ThirdPartyDependency [3c0dd727]:
 ThirdPartyDependency [3c0dd727] log:
 ├─ThirdPartyDependency [3c0dd727] has no known versions!
 └─restricted to versions * by MyPkg [04643c7a] — no versions left
   └─MyPkg [04643c7a] log:
     ├─possible versions are: 0.1.0 or uninstalled
     └─MyPkg [04643c7a] is fixed to version 0.1.0

```

Everything works okay if the third party registry is added (by hand) beforehand, but this is what I am trying to avoid, if possible.

Is there a way to have `Pkg.add` look for dependencies in third party registries, maybe by adding some directive in `Project.toml`? I guess I could just add the code that I need from those deps into `MyPkg` but that doesn’t seem like the correct thing to be doing here.
