Where or How to edit DEPOT_PATH

Dear community.

I am obviously too stupid to find it or use it correctly.

I want to change the folder julia uses to store the packages. I am working in an Active Directory environment and populating the user profile folders with thousands of small files makes logging in and out of the computer REALLY slow (10 minutes, compared to 1 minute before installation of julia).

I am using Julia v1.0.0 on Windows 8.1 64bit.

I have found that I should change DEPOT_PATH, but I cannot find out how or where.
In REPL, I can do

julia> JULIA_DEPOT_PATH="C:\\Julia\\packages\\v1.0"

However, if I then try to add a package, it still goes to the wrong location:

(v1.0) pkg> add Revise
   Cloning default registries into C:\Users\<myusername>\.julia\registries

I tried (v1.0) pkg> activate without success. (v1.0) pkg> init fails with ERROR: unexpected command. instead got [init].

Can somebody please help and point out how/where to change the environmental variables?
Thanks in advance


Set it before starting Julia, alternatively from inside julia you can modify the DEPOT_PATH variable (empty! it and push something to it).

I think you just added JULIA to the front of it. it should be DEPOT_PATH, instead of JULIA_DEPOT_PATH, and it should be a vector of strings, instead of a single string.

It may be better to set the environment variable before you run julia using your computer’s system preferences, or instead in your julia startup file.

The environment variable is indeed called JULIA_DEPOT_PATH

➜  export JULIA_DEPOT_PATH="mydepot"; ~/julia/julia -q
1-element Array{String,1}:

Ah I see. I think he was trying to edit the JULIA_DEPOT_PATH variable inside Julia’s REPL, which should be DEPOT_PATH instead.

Thank you for that hint.
As a hint for others reading this: Access to the environmental variables in Windows is gained by running (Win+R) sysdm.cpl --> Advanced tab —> System variables (button at the bottom of the tab).

Maybe someone, who is maintaining the documentation, could possibly include a sentence about this. Otherwise it is difficult for newbies to understand where they need to make the change.

That works, although I think it is a rather harsh method.
I did not expect it to be necessary to change system-wide settings so that one programme finds its folder. Do you (or anybody else) know, whether there is a special intention behind this?

1 Like

I tried this as well, although I had to figure out the push! command first (learned something new, thanks!).

However, this change is not persistent. As soon as I close and restart julia I get the old variables again.
I would prefer to make this setting persistent in julia rather than on the OS level. Would I have to change JuliaHomeDirectory/etc/julia/startup.jl to make it a permanent change?

Yes, that is one way to do it.

I think it’s fairly common to have programs rely on system-wide environment variables or configuration files to set their behavior. Even though you are setting it in system settings, unless another program also cares about JULIA_DEPOT_PATH, then it only affects the one program. Similarly, writing a configuration file to disk also changes your whole system, as potentially any program can read the file and change its behavior based on the file’s contents (though in practice none do). Many programs specific to Windows instead keep their configuration in Windows’ registry, which is also a system-wide change.

1 Like

O.K., I see your point.

However, I would suggest to change the installer or install process a little bit, because the process is not really user-friendly, especially for newbies (which julia might want to attract, having turned 1.0 now).
The (Windows) installer lets me choose where to install Julia. I think it would be good to have an option to also choose the package directory there.

Another option could be, to change the hard-coded DEPOT_PATH to point to a position relative to the directory julia gets installed into.

Last, but not least, I would like to stress again, that this should be explained in the manual. The manual only states that this variable can be set. No mentioning of where or how. All the examples one can find are using the markdown format that is otherwise used for REPL code:

I already got the idea that this was probably NOT the REPL, because the commands do not start with the usual julia>, pkg> or shell>. Linux-users and computer enthusiasts might grab it immediately that environment variables are OS-settings. But the normal (Windows) user usually does not care about such things, because the installers usually take care of setting those (possibly in the registry, as you pointed out).

I think there is still a discrepancy between the notion ported by “version 1.0” (in my opinion this means that it is released for the broader public, including inexperienced users) and the fact that there is still a lot to be done manually. Me and at least one more user (here) have pointed out that the manuals are still difficult to understand and seem to be written mainly with developers, experienced users or enthusiasts in mind. Just to get this “simple” change of the package directory to work, took me a few hours of research in the manual, this forum and stackoverflow, unfortunately, without success and I had to ask for your help (greatly appreciated!).

Please, don’t get me wrong or get offended. I know you are (most likely) not the person responsible for this. I just want to bring this issue to the awareness of the community.

As this is going beyond the point and title of this thread, should I open another thread to discuss this (where? Developer section?) or rather an issue on Github (obviously somebody had the same question already: here).

Could the @moderators help here as well, please? Thanks in advance.




This is true and the language is definitely 1.0 ready. However, the package manager itself is very new so have not had the time to mature as much as the rest of the language. The language cannot keep waiting for a package manager to completely catch up to make releases. So, while the new package manager will have some rough edges for a while, with user feedback I am sure we can get it up to speed quite quickly.

I want to note that, as a main developer, writing docs targeting an inexperienced is very hard. User feedback (like this one) is crucially needed. The best way to get things fixed is to open an issue at GitHub - JuliaLang/Pkg.jl: Pkg - Package manager for the Julia programming language, write down carefully what you tried to do and what information you lacked in order to quickly achieve that.

There is WIP for a FAQ (Add a FAQ · Issue #615 · JuliaLang/Pkg.jl · GitHub) where we could include answers to questions like this.


Thank you @kristoffer.carlsson.

Yes, I can imagine that. I’ll do my best to help.

I will open an issue at github. I did not notice that this is due to the package manager, I thought it was a general julia issue (as the environment variable is called JULIA_DEPOT_PATH).

Regarding the FAQ: Yes, I think it would be good to have it in there, too. Especially corporate users, who have their user folders synchronised with every login/logout will definitively benefit from changing the DEPOT_PATH.

1 Like

While it’s not technically about the package manager, it is quite strongly connected.

By the way: Is this a command I would use in the command line or powershell?

I know this is quite an old conversation, but I have recently been struggling with the same issue of DEPOT_PATH and how to set it in Windows. I have found a way that does not require permanent changes to the global environment variables. The syntax is a bit hairy with a few challenges so I thought it may save somebody else some time if I post my recipe here. I found experimentally that it is useless to set DEPOT_PATH from within the REPL. The package system keeps on using the original path. Your only option is setting the JULIA_DEPOT_PATH environment variable as indicated in previous posts. If you have a scenario where you do not want this change to be permanent, for example, you want to have a specific shortcut on your desktop that launches Julia from a different binary source and using a different DEPOT_PATH, here is how to do it:

  • Find the julia.exe file you want to launch and create a shortcut to it in your desktop or wherever you want it.

  • Open the properties of the shortcut and replace the Target command with the following:

C:\Windows\System32\cmd.exe /c “SET JULIA_DEPOT_PATH=yourdepotpath&&START /D yourjuliabinpath julia.exe”

  • Change the icon of the shortcut to something more appropriate than a black square.

You can add additional parameters before the final quote for example -i -q. Note that yourdepotpath will be interpreted by both cmd.exe and Julia and should be escaped accordingly. This can get tricky so keep the path simple. The yourjuliabinpath is interpreted by cmd.exe only so that is much easier. For cmd escaping, use the ^-character.

This post is getting too long so I will end with the word relocatable.

This doesn’t work for me. Julia won’t even start.
Can you explain, please, what am I doing wrong?
C:\Windows\System32\cmd.exe /c “SET JULIA_DEPOT_PATH=C:\\Iulian\\julia-1.5.2-win64\\.julia&&START /D C:\\Iulian\\julia-1.5.2-win64\\julia-1.5.2\\bin julia.exe”

could you tell me what step you did?
i read it but i dont know what i need to do, I can’t find any video to help, it’s too hard to visualize, please help me.

could you please take a moment to make a demonstration video for me, i have read that article, but i don’t understand how to do it, i don’t know what is environment variable? i don’t know how to config or setup

maybe i have to give up julia, no one helps me.