Change location of .julia

I am currently in the process of installing Julia in the ChromeOS shell. I have julia running OK, but I cannot seem to install some packages because the .julia directory is located in the noexec home folder. I would like to move .julia to a different location, but am having trouble finding information on how to do that for v1.1.0.

How can I change the location of .julia?

A symlink might be easiest. Within Julia, I think it’s DEPOT_PATH.

1 Like

See https://docs.julialang.org/en/v1.2-dev/manual/environment-variables/#JULIA_DEPOT_PATH-1

2 Likes

export JULIA_DEPOT_PATH="/usr/local/.julia" in my .bashrc did the trick, thanks!

For anyone wondering how to make this work on Windows, here is an example I used to move the .julia folder in the Julia installation folder. I simply created a new environment variable JULIA_DEPOT_PATH with the following three paths C:\Julia-1.3.1\.julia\;C:\Julia-1.3.1\local\share\julia\;C:\Julia-1.3.1\share\julia\. Basically the first path sets the new .julia folder location.

I needed to move the .julia folder because I generated a new sysimage with Plots bundled and wanted to use it on multiple computers by simply copying it. The original .julia location was hindering this because each computer had a different username.

This approach makes the Julia installation (with the .julia and packages) on Windows more portable, as long as the user sets the environment variable with the corresponding paths.
I am also planning to make a .bat file to add more easily the environment variable.

Working on this made me wonder if the Windows Julia installer could be modified in order to offer the user the possibility to choose the location for the .julia folder.

3 Likes

Does this still work in VERSION=1.6?

I’m on Windows and used:

C:\Users\user>set JULIA_DEPOT_PATH="C:\.julia"

C:\Users\user>echo %JULIA_DEPOT_PATH%
"C:\.julia"

After that I deleted my C:\Users\user\.julia folder and started julia.

But this happend:


(@v1.6) pkg> st
      Status `C:\Users\user\.julia\environments\v1.6\Project.toml` (empty project)

For me it still works. I set the Depot path manually using the environment variables window, but this shouldn’t matter. I never tried however setting it directly to C:. Maybe start julia as admin?

I double checked using C: location:

(@v1.6) pkg> st
      Status `C:\.julia\environments\v1.6\Project.toml` (empty project)

Sorry I got it to work. I just posted the solution thread above. Thx!

1 Like

hi guys
i am a newbie Julia
i have created my own environment and named it “demo”, i want the downloaded packages to be in the demo folder, i have activated the demo environment, why when i use the command “add PyCall” the packages get installed put in folder C? I don’t want to use C folder for installing package.
please help me, i am using julia 1.6

the solution of this post answers your question and please don’t ask duplicated question in short interval

1 Like