# Add repo outside of github as dependency to local package

**URL:** <https://discourse.julialang.org/t/add-repo-outside-of-github-as-dependency-to-local-package/77209>\
**Category:** General Usage\
**Tags:** question, pkg\
**Created:** [February 28, 2022, 9:28pm UTC](https://discourse.julialang.org/t/add-repo-outside-of-github-as-dependency-to-local-package/77209 "2022-02-28T21:28:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [February 28, 2022, 9:28pm UTC](https://discourse.julialang.org/t/add-repo-outside-of-github-as-dependency-to-local-package/77209/1 "2022-02-28T21:28:03Z")

</div>

Hi all,

I have a project that is set up as a local package using PkgTemplates. I would like to add a private Julia package that is hosted on a git repo outside of Github. I am having trouble getting it to work.

I added the package via the url (note this is not the real URL):

`] add my_url.git`

(I also tried without .git). After entering my name and password, everything seemed to download and update correctly. When I check the status I get the following:

```
  Status `~/.julia/dev/temp/Project.toml`

```

[31c24e10] Distributions v0.25.49  
[144cker13] MyPackag v0.1.0 `my_url.git#master`

Project.toml and Manifest.toml look normal as far as I can tell. I see the package in .julia/packages. However, when activate my environment and enter `using MyPackage`, I receive an error indicating MyPackage is not installed. However, if I try `using Distributions` it loads (note distributions is not in my global environment, so it can only load from the project environment). Is there something I need to do to get it to work?

Thanks!

---

<div class="post-metadata">

**Author:** ![albheim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albheim/32/34660_2.png) [@albheim](https://discourse.julialang.org/u/albheim)\
**Post date:** [February 28, 2022, 9:46pm UTC](https://discourse.julialang.org/t/add-repo-outside-of-github-as-dependency-to-local-package/77209/2 "2022-02-28T21:46:52Z")

</div>

It sounds like it should work to me.

Can you provide any more specifik details, e.g. the error trace you get?

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [February 28, 2022, 9:58pm UTC](https://discourse.julialang.org/t/add-repo-outside-of-github-as-dependency-to-local-package/77209/3 "2022-02-28T21:58:07Z")

</div>

Thanks for your reply. Here is the trace:

```julia
julia> using MyPackage
ERROR: ArgumentError: Package MyPackage not found in current path:
- Run `import Pkg; Pkg.add("MyPackage")` to install the MyPackage package.

Stacktrace:
  [1] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:967
  [2] eval
    @ ./boot.jl:373 [inlined]
  [3] eval
    @ ./Base.jl:68 [inlined]
  [4] repleval(m::Module, code::Expr, #unused#::String)
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.5.11/scripts/packages/VSCodeServer/src/repl.jl:157
  [5] (::VSCodeServer.var"#71#73"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.5.11/scripts/packages/VSCodeServer/src/repl.jl:123
  [6] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging ./logging.jl:511
  [7] with_logger
    @ ./logging.jl:623 [inlined]
  [8] (::VSCodeServer.var"#70#72"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.5.11/scripts/packages/VSCodeServer/src/repl.jl:124
  [9] #invokelatest#2
    @ ./essentials.jl:716 [inlined]
 [10] invokelatest(::Any)
    @ Base ./essentials.jl:714
 [11] macro expansion
    @ ~/.vscode/extensions/julialang.language-julia-1.5.11/scripts/packages/VSCodeServer/src/eval.jl:34 [inlined]
 [12] (::VSCodeServer.var"#55#56")()
    @ VSCodeServer ./task.jl:423

```

---

<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:** [February 28, 2022, 10:07pm UTC](https://discourse.julialang.org/t/add-repo-outside-of-github-as-dependency-to-local-package/77209/4 "2022-02-28T22:07:12Z")

</div>

> [@Christopher\_Fisher](#):
>
> [144cker13] MyPackag v0.1.0 `my_url.git#master`

Is this just a typo in manual scrubbing of actual URL/package name? Otherwise, this might indicate a typo in your project file (`MyPackag` → `MyPackage`).

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [February 28, 2022, 10:08pm UTC](https://discourse.julialang.org/t/add-repo-outside-of-github-as-dependency-to-local-package/77209/5 "2022-02-28T22:08:32Z")

</div>

The most common explanations to this are

1. You made a typo in the package name (capitalization, whatever).
2. You are not running in the environment you think you are.
3. You didn’t add the package to the environment you think you did.

You might have some other problem but do what you can to rule out all of the above first.

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [February 28, 2022, 10:10pm UTC](https://discourse.julialang.org/t/add-repo-outside-of-github-as-dependency-to-local-package/77209/6 "2022-02-28T22:10:29Z")

</div>

Sorry about that. Yeah. I scrubbed some of the info and introduced a typo. I double checked Project.toml and the correct package name is there along with the uuid under deps.

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [February 28, 2022, 10:13pm UTC](https://discourse.julialang.org/t/add-repo-outside-of-github-as-dependency-to-local-package/77209/7 "2022-02-28T22:13:58Z")

</div>

You may also want to try this from a plain REPL to rule out that VSCode is confounding matters.

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [February 28, 2022, 10:16pm UTC](https://discourse.julialang.org/t/add-repo-outside-of-github-as-dependency-to-local-package/77209/8 "2022-02-28T22:16:35Z")

</div>

I deleted Project.toml and Manifest.toml, repeated the setup, and now it is working. I have no idea what was causing the problem. I probably did something wrong, but I still have no clue 😆. At least it is working now. Thank you everyone for your help nonetheless.
