# How to install package dependencies for unregistered package

**URL:** https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088
**Category:** General Usage
**Tags:** packages
**Created:** [March 17, 2020, 8:58am UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088 "2020-03-17T08:58:50Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![sloede](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sloede/32/44787_2.png) [@sloede](https://discourse.julialang.org/u/sloede)
#### Post date: [March 17, 2020, 8:58am UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088/1 "2020-03-17T08:58:50Z")

</div>

I have created a few packages for numerical simulations, which are not (yet) registered anywhere. My current development workflow is to just clone the repository manually and to use a script to start the simulations (which includes the main module file and then starts the main method).

The `Project.toml`/`Manifest.toml` files of the package include all required packages. However, I am wondering how new users can easily install all dependencies for the package in their main Julia environment (i.e., as if I use `add PackageName` for regular, registered packages)?

If I do `] activate .` + `instantiate` in my project, it will download & install all dependencies but does not make them available if I do not start julia with `--project=.`. ☹

---

<div class="post-metadata">

### Author: ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)
#### Post date: [March 17, 2020, 9:09am UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088/2 "2020-03-17T09:09:16Z")

</div>

> [@sloede](#):
>
> If I do `] activate .` + `instantiate` in my project, it will download & install all dependencies but does not make them available if I do not start julia with `--project=.` . ☹

That is as per design: when you activate the project then the installation of packages happens into that project and not into the global environment. Just work in that project. Or is there a reason not to?

---

<div class="post-metadata">

### Author: ![sloede](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sloede/32/44787_2.png) [@sloede](https://discourse.julialang.org/u/sloede)
#### Post date: [March 17, 2020, 9:36am UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088/3 "2020-03-17T09:36:10Z")

</div>

Thank you for your answer. I am looking at this from a usability perspective: Our modules are to be used regularly by novice users (students…) with little programming experience, and we want to make the experience for them as smooth as possible. Therefore, I was hoping that there is a way to avoid calling `--project=path/to/module` each time they run the module scripts with `julia` - really just to make it as hassle-free as possible for the students (and their advisor 😉 ).

However, I understand the design choice (and support it). I just wanted to see if there is a way to do it (or, alternatively, to confirm that there is no sane way to achieve what I was hoping to do, such that I can stop looking).

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [March 17, 2020, 9:39am UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088/4 "2020-03-17T09:39:06Z")

</div>

> [@sloede](#):
>
> avoid calling `--project=path/to/module` each time they run the module scripts with `julia` - really just to make it as hassle-free as possible for the students (and their advisor 😉 ).

Think of it as a feature — the intention is to provide a reproducible environment.

Debugging issues from a mismatched environment is usually guaranteed to be two orders of magnitude more hassle than this.

---

<div class="post-metadata">

### Author: ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)
#### Post date: [March 17, 2020, 9:43am UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088/5 "2020-03-17T09:43:42Z")

</div>

I have an alias for `alias juliap='julia --project=@.'` and start julia in the project folder with `juliap`. Maybe that is an option for your students? I think jupyter notebooks have something similar built-in, but I might be wrong.

---

<div class="post-metadata">

### Author: ![sloede](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sloede/32/44787_2.png) [@sloede](https://discourse.julialang.org/u/sloede)
#### Post date: [March 17, 2020, 9:47am UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088/6 "2020-03-17T09:47:34Z")

</div>

Nope, I agree. But just to be sure: There is no sane way to achieve what I try to do, except by installing all packages by hand?

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [March 17, 2020, 9:49am UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088/7 "2020-03-17T09:49:05Z")

</div>

Providing the manifest and then `pkg> instantiate`?

---

<div class="post-metadata">

### Author: ![sloede](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sloede/32/44787_2.png) [@sloede](https://discourse.julialang.org/u/sloede)
#### Post date: [March 17, 2020, 9:51am UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088/8 "2020-03-17T09:51:48Z")

</div>

Sorry, I was not clear enough: How to install all packages automatically in the default environment?

The project already ships with a `Project.toml` and `Manifest.toml`, but AFAIU, `instantiate` will only install the packages for the currently activated project (or am I missing something?).

---

<div class="post-metadata">

### Author: ![sloede](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sloede/32/44787_2.png) [@sloede](https://discourse.julialang.org/u/sloede)
#### Post date: [March 17, 2020, 9:52am UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088/9 "2020-03-17T09:52:44Z")

</div>

> [@mauro3](#):
>
> I have an alias for `alias juliap='julia --project=@.'`

What does the `@.` do for you that the `.` does not? Other than that, good suggestion, thank you!

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [March 17, 2020, 10:00am UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088/10 "2020-03-17T10:00:37Z")

</div>

The idea is to activate that project, then instantiate from the manifest.

What you are proposing (doing this in the default environment) is very brittle: what if Julia is used for some other purpose, packages are updated accidentally, etc.

---

<div class="post-metadata">

### Author: ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)
#### Post date: [March 17, 2020, 10:18am UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088/11 "2020-03-17T10:18:53Z")

</div>

The help says

```julia
--project[={<dir>|@.}] Set <dir> as the home project/environment

```

I think it has something to do with the shell interpreting `.` specially, but I don’t know.

---

<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: [March 17, 2020, 11:21am UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088/12 "2020-03-17T11:21:54Z")

</div>

> [@sloede](#):
>
> Nope, I agree. But just to be sure: There is no sane way to achieve what I try to do, except by installing all packages by hand?

The sane solution is to register your packages. If they are not material for the General registry, create your own registry. See [GitHub - GunnarFarneback/LocalRegistry.jl: Create and maintain local registries for Julia packages.](https://github.com/GunnarFarneback/LocalRegistry.jl) for tools.

---

<div class="post-metadata">

### Author: ![sloede](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sloede/32/44787_2.png) [@sloede](https://discourse.julialang.org/u/sloede)
#### Post date: [March 17, 2020, 12:08pm UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088/13 "2020-03-17T12:08:38Z")

</div>

> [@GunnarFarneback](#):
>
> The sane solution is to register your packages. If they are not material for the General registry, create your own registry. See [GitHub - GunnarFarneback/LocalRegistry.jl: Create and maintain local registries for Julia packages.](https://github.com/GunnarFarneback/LocalRegistry.jl) for tools.

Thank you for the advice and the hint to your package. However, the overall Package/Registry setup is very Julia-specific and _way more involved_ than what I can expect my targeted user demographic (students with little programming or console experience) to handle.

If my users are able to install Julia and git, clone a Julia package, and run its scripts, without needing personal assistance from my side, I am already happy 😉 For this very specific use case I was looking for a simple solution to have them install all required dependencies with (preferably) a single command.

Nevertheless, we will eventually register the packages (either with the General registry or a domain-specific one), and make them work as Julia intends it.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [March 17, 2020, 12:28pm UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088/14 "2020-03-17T12:28:11Z")

</div>

> [@sloede](#):
>
> install Julia and git, clone a Julia package, and run its scripts, without needing personal assistance from my side, I am already happy

I don’t know what you are teaching, but if it involves programming, these may be skills that can be reasonable expected (especially if help is available on demand).

Alternatively, you can set up a Jupyter server with everything pre-installed, so students who are unwilling to deal with all of the above can use it as a fallback.

---

<div class="post-metadata">

### Author: ![sloede](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sloede/32/44787_2.png) [@sloede](https://discourse.julialang.org/u/sloede)
#### Post date: [March 17, 2020, 12:35pm UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088/15 "2020-03-17T12:35:39Z")

</div>

> [@Tamas\_Papp](#):
>
> Alternatively, you can set up a Jupyter server with everything pre-installed, so students who are unwilling to deal with all of the above can use it as a fallback

I already tried this but failed to set up a central Julia installation with multiple pre-installed modules. Everything seems to work, except the Julia kernel won’t start when requested from JupyterHub. Anyways, thanks for your input!

---

<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: [March 17, 2020, 2:05pm UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088/16 "2020-03-17T14:05:23Z")

</div>

> [@sloede](#):
>
> Thank you for the advice and the hint to your package. However, the overall Package/Registry setup is very Julia-specific and _way more involved_ than what I can expect my targeted user demographic (students with little programming or console experience) to handle.

I’m not quite following you here. Creating the registry and registering the packages would fall entirely on you and not involve students at all.

> [@sloede](#):
>
> If my users are able to install Julia and git, clone a Julia package, and run its scripts, without needing personal assistance from my side, I am already happy 😉 For this very specific use case I was looking for a simple solution to have them install all required dependencies with (preferably) a single command.

When you have the packages registered you get the dependency management for free from the package manager. The setup scenario would be

- Install Julia.
- Start Julia.
- Run the following (or equivalent commands in Pkg REPL mode):

```julia
using Pkg
pkg"registry add General https://url.to/your/registry.git"
pkg"add YourUserFacingPackage"

```

---

<div class="post-metadata">

### Author: ![sloede](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sloede/32/44787_2.png) [@sloede](https://discourse.julialang.org/u/sloede)
#### Post date: [March 18, 2020, 10:38am UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088/17 "2020-03-18T10:38:05Z")

</div>

> [@GunnarFarneback](#):
>
> When you have the packages registered you get the dependency management for free from the package manager. The setup scenario would be
> 
> - Install Julia.
> - Start Julia.
> - Run the following (or equivalent commands in Pkg REPL mode)

But this precludes me from simply cloning and editing the files during the development process, correct? Since I cannot (should not?) edit the downloaded package directly in `~/.julia`, as far as I understand it. Even if I use `dev MyPackage` it will end up in `~/.julia/dev` or in the fixed path `JULIA_PKG_DEVDIR` (according to [https://julialang.github.io/Pkg.jl/stable/managing-packages/#Developing-packages-1](https://julialang.github.io/Pkg.jl/stable/managing-packages/#Developing-packages-1)).

Is there a way around this such as, e.g., using `dev path/to/my/files` to track a locally cloned repository? Or will that also just re-clone the package at `path/to/my/files` to `JULIA_PKG_DEVDIR`?

---

<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: [March 18, 2020, 10:48am UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088/18 "2020-03-18T10:48:24Z")

</div>

> [@sloede](#):
>
> Since I cannot (should not?) edit the downloaded package directly in `~/.julia` , as far as I understand it.

You should not edit packages in `~/.julia/packages`. Developed packages in `~/.julia/dev` are fine to edit; that’s kind of the idea of `develop`.

> [@sloede](#):
>
> Is there a way around this such as, e.g., using `dev path/to/my/files` to track a locally cloned repository?

Yes, if you `develop` a local path, whatever is in that path will be used, in place.

---

<div class="post-metadata">

### Author: ![sloede](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sloede/32/44787_2.png) [@sloede](https://discourse.julialang.org/u/sloede)
#### Post date: [March 18, 2020, 10:50am UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088/19 "2020-03-18T10:50:16Z")

</div>

Thank you very much for these clarifications!

> [@GunnarFarneback](#):
>
> Yes, if you `develop` a local path, whatever is in that path will be used, in place.

Just to be sure: in-place means that no clone will be made to `~/.julia/dev` but that the files in the local path will be used directly?

---

<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: [March 18, 2020, 10:52am UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088/20 "2020-03-18T10:52:43Z")

</div>

> [@sloede](#):
>
> Just to be sure: in-place means that no clone will be made to `~/.julia/dev` but that the files in the local path will be used directly?

Yes.

[Next page](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088.md?page=2)
