# JULIA\_PKGDIR and Julia-0.7

**URL:** <https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672>\
**Category:** General Usage\
**Created:** [June 14, 2018, 11:17am UTC](https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672 "2018-06-14T11:17:54Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![abobroff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abobroff/32/3752_2.png) [@abobroff](https://discourse.julialang.org/u/abobroff)\
**Post date:** [June 14, 2018, 11:17am UTC](https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672/1 "2018-06-14T11:17:54Z")

</div>

How do I assign my own directory for packages in Julia - 0.7.0 (analogue of the definition of JULIA\_PKGDIR in file juliars.jl for Julia-0.6)?  
Windows 8, 10.

---

<div class="post-metadata">

**Author:** ![dawbarton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dawbarton/32/215461_2.png) [@dawbarton](https://discourse.julialang.org/u/dawbarton)\
**Post date:** [June 14, 2018, 11:40am UTC](https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672/2 "2018-06-14T11:40:23Z")

</div>

I think this is [`JULIA_DEPOT_PATH`](https://docs.julialang.org/en/latest/stdlib/Pkg/) in v0.7.

---

<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:** [June 14, 2018, 11:43am UTC](https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672/3 "2018-06-14T11:43:09Z")

</div>

What are you using it for? It is highly likely that what you used it for in Julia v0.6 is not needed anymore with the new package manager.

---

<div class="post-metadata">

**Author:** ![dawbarton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dawbarton/32/215461_2.png) [@dawbarton](https://discourse.julialang.org/u/dawbarton)\
**Post date:** [June 14, 2018, 11:49am UTC](https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672/4 "2018-06-14T11:49:30Z")

</div>

It’s very useful for me to avoid putting lots under my home directory (which sits on a network drive) and have it on local storage instead (though the OP could well have a different use case).

Though I notice that packages checked out with `]develop` still end up in my home directory - I’ve not worked out how to change that yet.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [June 14, 2018, 11:54am UTC](https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672/5 "2018-06-14T11:54:33Z")

</div>

You can set `ENV["JULIA_PKG_DEVDIR"]` to change the default location of where Pkg puts packages that are `dev`ed.

Note that there is nothing special with this directory. You can put packages anywhere and `dev localpath` them (where `localpath` is the path to the local package).

---

<div class="post-metadata">

**Author:** ![dawbarton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dawbarton/32/215461_2.png) [@dawbarton](https://discourse.julialang.org/u/dawbarton)\
**Post date:** [June 14, 2018, 11:59am UTC](https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672/6 "2018-06-14T11:59:32Z")

</div>

Thanks, that’s good to know.

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [June 14, 2018, 12:10pm UTC](https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672/7 "2018-06-14T12:10:39Z")

</div>

So, if you have a package on GitHub in an org, the directory in ENV[“JULIA\_PKG\_DEVDIR”] will have a local git clone of the package if you do `dev <packagename>`?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [June 14, 2018, 12:14pm UTC](https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672/8 "2018-06-14T12:14:14Z")

</div>

Yes, in `joinpath(ENV[“JULIA_PKG_DEVDIR”], PackageName)`. Not sure using an env variable for this is the best but that is how it is right now.

---

<div class="post-metadata">

**Author:** ![goedman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goedman/32/217_2.png) [@goedman](https://discourse.julialang.org/u/goedman)\
**Post date:** [June 14, 2018, 12:36pm UTC](https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672/9 "2018-06-14T12:36:57Z")

</div>

That seems indeed to be the package development/update configuration. I still run into a chicken and egg situation for new packages where ‘develop’ can’t resolve the package. In those cases I add the package to the v0.7 project, clone the package to the designated ‘dev’ location and then execute ‘develop PkgName’. I wonder if in the future ‘generate’ is supposed to simplify this step. Currently ‘generate’ creates a bare minimum project (I think, e.g. no License file, appveyor.yml, etc.).

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [June 14, 2018, 12:40pm UTC](https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672/10 "2018-06-14T12:40:55Z")

</div>

> [@goedman](#):
>
> Currently ‘generate’ creates a bare minimum project (I think, e.g. no License file, appveyor.yml, etc.).

Yes, it is barebone right now because when it was written it wasn’t clear exactly how things would look.

> [@goedman](#):
>
> I still run into a chicken and egg situation for new packages where ‘develop’ can’t resolve the package.

Some stuff related to this was recently fixed but please open issues with workflow problems.

---

<div class="post-metadata">

**Author:** ![goedman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goedman/32/217_2.png) [@goedman](https://discourse.julialang.org/u/goedman)\
**Post date:** [June 14, 2018, 1:47pm UTC](https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672/11 "2018-06-14T13:47:12Z")

</div>

Thanks Kristoffer, yes, I understand (and agree with) the reasoning for keeping it barebone.

On the chicken and egg remark, I’ll get back on that in an issue on Pkg (although I don’t think it is an issue, more a question about a suggested workflow, we’ve always had that intermediate step of uploading to Github). Once that has been done, Pkg.add() updates the uncurated registry.

---

<div class="post-metadata">

**Author:** ![jheinen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jheinen/32/2787_2.png) [@jheinen](https://discourse.julialang.org/u/jheinen)\
**Post date:** [June 14, 2018, 4:14pm UTC](https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672/12 "2018-06-14T16:14:47Z")

</div>

We used `JULIA_PKGDIR` and `JULIA_LOAD_PATH` to share a set of common packages among users in a managed desktop environment for Linux, Windows and Mac hosts. What would be the preferred method to establish such behaviour with 0.7?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [June 14, 2018, 8:07pm UTC](https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672/13 "2018-06-14T20:07:17Z")

</div>

There are a few different ways and which one is best depends on your use case.

One way is to have your own registry. Pkg3 supports multiple simultaneous registries so by putting your own registry in `.julia/registries` (in addition to the default one) you can have your own set of packages, add and upgrade them exactly like the ones in the default registry. The tooling for setting up a registry is however lacking at the moment.

Another is to track git repositories using `pkg> add localpath#branch` where `localpath` is a path to a git repository. This works exactly like adding a repo at some branch from the internet. When commits are added to the branch, `update` will pull them in.

The third way is to track a directory, i.e. saying that julia should load the package from a certain path. This is done by doing `dev localpath` where localpath is a path to a package (doesn’t have to be a git repository). This simply tells julia that when loading the package, load it from that path. Any changes made to the files in that path is reflected when the package is reloaded.

---

<div class="post-metadata">

**Author:** ![jheinen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jheinen/32/2787_2.png) [@jheinen](https://discourse.julialang.org/u/jheinen)\
**Post date:** [June 15, 2018, 6:17am UTC](https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672/14 "2018-06-15T06:17:35Z")

</div>

@kristoffer.carlsson thanks for the explanations. The ideal solution would be something like a JULIAPATH environment (analog to Python’s PYTHONPATH) where one could specify a list of directories where to look for packages. This would be very useful for managed multi-user desktop environments.

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [June 15, 2018, 9:11pm UTC](https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672/15 "2018-06-15T21:11:20Z")

</div>

That exists, it’s called LOAD\_PATH and it’s controlled by the JULIA\_LOAD\_PATH environment variable.

---

<div class="post-metadata">

**Author:** ![simon](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@simon](https://discourse.julialang.org/u/simon)\
**Post date:** [September 20, 2018, 9:50pm UTC](https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672/16 "2018-09-20T21:50:37Z")

</div>

When updating packages from Julia v0.6.3 to v0.7.0, I changed the directory to a non-system disk. Now they are in new path: JULIA\_DEPOT\_PATH.

Would it be safe now to delete the old packages in system disk?  
(Win10+VScode)

---

<div class="post-metadata">

**Author:** ![cortner](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cortner/32/204_2.png) [@cortner](https://discourse.julialang.org/u/cortner)\
**Post date:** [January 30, 2019, 10:47pm UTC](https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672/17 "2019-01-30T22:47:55Z")

</div>

I didn’t find `JULIA_DEPOT_PATH` in the documentation. Could this be added?

---

<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:** [January 30, 2019, 10:57pm UTC](https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672/18 "2019-01-30T22:57:59Z")

</div>

Absolutely, see [List JULIA\_DEPOT\_PATH under Environment variables in the docs · Issue #29714 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/29714). Feel like contributing?
