DEPOT_PATH undefined despite JULIA_DEPOT_PATH being defined in the Environment

I have had Julia1.2 installed on a remote linux server and can start it up and run commands, but cannot import any modules (e.g. ‘using Pkg’)

I get the error ERROR: LoadError: UndefVarError: DEPOT_PATH not defined

All documents I have read say that this should not be an issue if JULIA_DEPOT_PATH is defined,
which in my case it is (I can type ‘ENV’ at the Julia commandline and see it there pointing to the
right places).

I tried various ways to manually set DEPOT_PATH but none worked, and all advice online seems to say that I should not do this, but merely make sure JULIA_DEPOT_PATH is defined (which it is).
So far, I have spent 16 hours trying to rectify this. Can anyone help?

Most users don’t need to set either variable if they have a standard setup. So the first thing I would try is just not setting this manually, and use the standard setup.

How did you install Julia on the server?

I would just recommend getting the latest released version (1.3.x), and installing it in your home directory.

I am responsible for the administration of the software used on our HPC and we also have a Julia 1.2 installation, which works fine by setting the JULIA_DEPOT_PATH:

░ tgal@cca010:~
░ 08:46:10 > module load julia/1.2.0
░ tgal@cca010:~
░ 08:46:28 > env|grep JULIA
JULIA_DEPOT_PATH=/pbs/home/t/tgal/.julia
░ tgal@cca010:~
░ 08:46:34 > julia --version
julia version 1.2.0

All I did there once was extracting the official Julia release (tar ball from Download Julia) and set the JULIA_DEPOT_PATH based on the user’s home directory. No-one complained so far.

Then I tried to reproduce your problem with a fresh Docker container of Julia 1.2 but everything works:

░ tgal@staticbox:~
░ 08:47:50 > docker run -it julia:1.2 bash
Unable to find image 'julia:1.2' locally
1.2: Pulling from library/julia
000eee12ec04: Pull complete
7eaf7370ec9c: Pull complete
43d38792bfb3: Pull complete
Digest: sha256:61836817b814b6fb023a6c99148baf30ed684821b77e4a2ef64d9c476e67070a
Status: Downloaded newer image for julia:1.2
root@3b6dc6b96691:/# env|grep JULIA
JULIA_GPG=3673DF529D9049477F76B37566E3C7DC03D6E495
JULIA_VERSION=1.2.0
JULIA_PATH=/usr/local/julia
root@3b6dc6b96691:/# julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.2.0 (2019-08-20)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(v1.2) pkg> add PGFPlotsX
   Cloning default registries into `~/.julia`
   Cloning registry from "https://github.com/JuliaRegistries/General.git"
     Added registry `General` to `~/.julia/registries/General`
 Resolving package versions...
 Installed Requires ──────────── v1.0.0
 Installed Missings ──────────── v0.4.3
 Installed ArgCheck ──────────── v1.0.1
 Installed DataAPI ───────────── v1.1.0
 Installed Parameters ────────── v0.12.0
 Installed DocStringExtensions ─ v0.8.1
 Installed DataStructures ────── v0.17.9
 Installed PGFPlotsX ─────────── v1.2.1
 Installed SortingAlgorithms ─── v0.3.1
 Installed MacroTools ────────── v0.5.3
 Installed DefaultApplication ── v0.1.3
 Installed OrderedCollections ── v1.1.0
 Installed StatsBase ─────────── v0.32.0
  Updating `~/.julia/environments/v1.2/Project.toml`
  [8314cec4] + PGFPlotsX v1.2.1
  Updating `~/.julia/environments/v1.2/Manifest.toml`
  [dce04be8] + ArgCheck v1.0.1
  [9a962f9c] + DataAPI v1.1.0
  [864edb3b] + DataStructures v0.17.9
  [3f0dd361] + DefaultApplication v0.1.3
  [ffbed154] + DocStringExtensions v0.8.1
  [1914dd2f] + MacroTools v0.5.3
  [e1d29d7a] + Missings v0.4.3
  [bac558e1] + OrderedCollections v1.1.0
  [8314cec4] + PGFPlotsX v1.2.1
  [d96e819e] + Parameters v0.12.0
  [ae029012] + Requires v1.0.0
  [a2af1166] + SortingAlgorithms v0.3.1
  [2913bbd2] + StatsBase v0.32.0
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8ba89e20] + Distributed
  [b77e0a4c] + InteractiveUtils
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [44cfe95a] + Pkg
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays
  [10745b16] + Statistics
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode

(v1.2) pkg>
root@3b6dc6b96691:/# ls
bin  boot  dev	etc  home  lib	lib64  media  mnt  opt	proc  root  run  sbin  srv  sys  tmp  usr  var
root@3b6dc6b96691:/# mkdir juliadepot
root@3b6dc6b96691:/# export JULIA_DEPOT_PATH=/juliadepot
root@3b6dc6b96691:/# julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.2.0 (2019-08-20)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(v1.2) pkg> st
    Status `/juliadepot/environments/v1.2/Project.toml`
  (empty environment)

(v1.2) pkg> add PGFPlotsX
   Cloning default registries into `/juliadepot`
   Cloning registry from "https://github.com/JuliaRegistries/General.git"
     Added registry `General` to `/juliadepot/registries/General`
 Resolving package versions...
 Installed Requires ──────────── v1.0.0
 Installed Missings ──────────── v0.4.3
 Installed DataAPI ───────────── v1.1.0
 Installed ArgCheck ──────────── v1.0.1
 Installed Parameters ────────── v0.12.0
 Installed DocStringExtensions ─ v0.8.1
 Installed PGFPlotsX ─────────── v1.2.1
 Installed DataStructures ────── v0.17.9
 Installed DefaultApplication ── v0.1.3
 Installed MacroTools ────────── v0.5.3
 Installed SortingAlgorithms ─── v0.3.1
 Installed StatsBase ─────────── v0.32.0
 Installed OrderedCollections ── v1.1.0
  Updating `/juliadepot/environments/v1.2/Project.toml`
  [8314cec4] + PGFPlotsX v1.2.1
  Updating `/juliadepot/environments/v1.2/Manifest.toml`
  [dce04be8] + ArgCheck v1.0.1
  [9a962f9c] + DataAPI v1.1.0
  [864edb3b] + DataStructures v0.17.9
  [3f0dd361] + DefaultApplication v0.1.3
  [ffbed154] + DocStringExtensions v0.8.1
  [1914dd2f] + MacroTools v0.5.3
  [e1d29d7a] + Missings v0.4.3
  [bac558e1] + OrderedCollections v1.1.0
  [8314cec4] + PGFPlotsX v1.2.1
  [d96e819e] + Parameters v0.12.0
  [ae029012] + Requires v1.0.0
  [a2af1166] + SortingAlgorithms v0.3.1
  [2913bbd2] + StatsBase v0.32.0
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8ba89e20] + Distributed
  [b77e0a4c] + InteractiveUtils
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [44cfe95a] + Pkg
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays
  [10745b16] + Statistics
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode

julia> using PGFPlotsX
[ Info: Precompiling PGFPlotsX [8314cec4-20b6-5062-9cdb-752b83310925]

julia>
root@3b6dc6b96691:/# ls juliadepot/
compiled  environments	logs  packages	registries
root@3b6dc6b96691:/# 

There is something missing in your environment description or something crucial you did not tell yet. If you really only set JULIA_DEPOT_PATH, it should work. Maybe you show the full output of env | grep JULIA and also tell us how you installed Julia.

I repeated the whole exercise using the Pkg module directly instead of the package mode, which you activate by hitting ]

It’s working too:

░ tgal@staticbox:~ took 7m 4s
░ 08:54:59 > docker run -it julia:1.2 bash
root@f7c4157d56b2:/# julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.2.0 (2019-08-20)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Pkg

julia> Pkg.add("UnicodePlots")
   Cloning default registries into `~/.julia`
   Cloning registry from "https://github.com/JuliaRegistries/General.git"
     Added registry `General` to `~/.julia/registries/General`
 Resolving package versions...
 Installed Missings ─────────── v0.4.3
 Installed DataAPI ──────────── v1.1.0
 Installed SortingAlgorithms ── v0.3.1
 Installed DataStructures ───── v0.17.9
 Installed StatsBase ────────── v0.32.0
 Installed UnicodePlots ─────── v1.1.0
 Installed OrderedCollections ─ v1.1.0
  Updating `~/.julia/environments/v1.2/Project.toml`
  [b8865327] + UnicodePlots v1.1.0
  Updating `~/.julia/environments/v1.2/Manifest.toml`
  [9a962f9c] + DataAPI v1.1.0
  [864edb3b] + DataStructures v0.17.9
  [e1d29d7a] + Missings v0.4.3
  [bac558e1] + OrderedCollections v1.1.0
  [a2af1166] + SortingAlgorithms v0.3.1
  [2913bbd2] + StatsBase v0.32.0
  [b8865327] + UnicodePlots v1.1.0
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8ba89e20] + Distributed
  [b77e0a4c] + InteractiveUtils
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [de0858da] + Printf
  [9a3f8284] + Random
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays
  [10745b16] + Statistics
  [8dfed614] + Test
  [4ec0a83e] + Unicode

julia> using UnicodePlots
[ Info: Precompiling UnicodePlots [b8865327-cd53-5732-bb35-84acbb429228]

julia>
root@f7c4157d56b2:/# ls
bin  boot  dev	etc  home  lib	lib64  media  mnt  opt	proc  root  run  sbin  srv  sys  tmp  usr  var
root@f7c4157d56b2:/# mkdir juliadepot
root@f7c4157d56b2:/# export JULIA_DEPOT_PATH=/juliadepot
root@f7c4157d56b2:/# julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.2.0 (2019-08-20)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Pkg

julia> Pkg.status()
    Status `/juliadepot/environments/v1.2/Project.toml`
  (empty environment)

julia> Pkg.add("UnicodePlots")
   Cloning default registries into `/juliadepot`
   Cloning registry from "https://github.com/JuliaRegistries/General.git"
     Added registry `General` to `/juliadepot/registries/General`
 Resolving package versions...
 Installed DataAPI ──────────── v1.1.0
 Installed Missings ─────────── v0.4.3
 Installed SortingAlgorithms ── v0.3.1
 Installed OrderedCollections ─ v1.1.0
 Installed StatsBase ────────── v0.32.0
 Installed UnicodePlots ─────── v1.1.0
 Installed DataStructures ───── v0.17.9
  Updating `/juliadepot/environments/v1.2/Project.toml`
  [b8865327] + UnicodePlots v1.1.0
  Updating `/juliadepot/environments/v1.2/Manifest.toml`
  [9a962f9c] + DataAPI v1.1.0
  [864edb3b] + DataStructures v0.17.9
  [e1d29d7a] + Missings v0.4.3
  [bac558e1] + OrderedCollections v1.1.0
  [a2af1166] + SortingAlgorithms v0.3.1
  [2913bbd2] + StatsBase v0.32.0
  [b8865327] + UnicodePlots v1.1.0
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8ba89e20] + Distributed
  [b77e0a4c] + InteractiveUtils
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [de0858da] + Printf
  [9a3f8284] + Random
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays
  [10745b16] + Statistics
  [8dfed614] + Test
  [4ec0a83e] + Unicode

julia> using UnicodePlots
[ Info: Precompiling UnicodePlots [b8865327-cd53-5732-bb35-84acbb429228]

julia>
root@f7c4157d56b2:/# ls juliadepot/
compiled  environments	logs  packages	registries
root@f7c4157d56b2:/# 

For the sake of completeness, all I did to install (any) Julia version is as said above, extracting the tar ball from the downloads page somewhere and set PATH and LD_LIBRARY_PATH. Here is the relevant part of the modules file I am using (I prefer Environment Modules — Modules documentation to manage software):

set version 1.2.0
set pkgname Julia
set pkghome /pbs/throng/km3net/software/julia/$version
prepend-path PATH $pkghome/bin
prepend-path LD_LIBRARY_PATH $pkghome/lib
setenv JULIA_DEPOT_PATH $env(HOME)/.Julia

DEPOT_PATH should always be defined, so I would guess that your install is broken somehow. Alternatively you are not running Julia 1.2, but maybe Julia 0.6 which does not have this variable. What is the full error message including stacktrace?

Thank you so much for your thoughts on this.

One piece of information I didn’t include (because I didn’t think it mattered and didn’t want to ‘overshare’) is that at the commandline, julia works fine, but in this case, I am calling a julia script from within another program (SCILAB in this case), where I explicitly set JULIA_DEPOT_PATH equal to the right value. The main thing I don’t understand is why, in this case, does Julia subsequently complain that DEPOT_PATH is empty?
Again, this is an installation that works normally from the commandline.

Thanks for any insights.
PS If there were a way to set DEPOT_PATH inside Julia, that might be a workaround, but julia seems to disallow this.

You first said:

but now:

Which one is it? If the latter then it just looks like you have set JULIA_DEPOT_PATH incorrectly which resulted in an empty DEPOT_PATH.

There is, you can do whatever with the DEPOT_PATH variable, but it is not recommended, you should use the JULIA_DEPOT_PATH for this.

1 Like

Thanks for looking at this, it is the former… I thought not defined was the same as empty. As for JULIA_DEPOT_PATH, I set it to the same value that is used when I run Julia from the commandline (in which case all is fine). I even check it is the same value by printing out ENV(“JULIA_DEPOT_PATH”) which is the same in both cases. So why do you think it is that DEPOT_PATH is not defined at all for the case in question? Is there a startup script which is supposed to run, where things happen, like defining DEPOT_PATH from JULIA_DEPOT_PATH? Maybe that is not running. Can I run it explicitly? Thanks again for your help (this is driving me nuts!!! I have just lost a third nearly-full day on this, because if I don’t solve it, it means I have to go back to SCILAB :frowning:

The people on this (Ubuntu) server installed julia for me as a favour. I tried to make it as easy as possible for them, but there were no easy installers (snap is still on Julia1.0 and there were no ‘apt install’ -type solutions) so they had to configure everything by hand, and perhaps they didn’t get everything right. If at some point, someone builds an easy installer of Julia 1.2 or above for Ubuntu, maybe that would install everything correctly and I could come back to using Julia for this crucial application. [ I would be appreciative if someone could alert me]

This is how I generally install Julia in (Ubuntu-based) docker images:

RUN cd /opt \
 && wget https://julialang-s3.julialang.org/bin/linux/x64/1.2/julia-1.2.0-linux-x86_64.tar.gz \
 && mkdir julia \
 && tar xvfz julia-1.2.0-linux-x86_64.tar.gz --strip-components 1 -C julia
ENV PATH /opt/julia/bin:$PATH

The URL is straight off the Julia Downloads page.

It is impossible to just guess what is wrong, you have to give more information. What are you setting JULIA_DEPOT_PATH to for example?

DEPOT_PATH is populated in the init funciton from JULIA_LOAD_PATH, and I don’t think there is a way to not run it, so I think the problem is that your JULIA_LOAD_PATH just results in an empty DEPOT_PATH. What happens when you unset JULIA_DEPOT_PATH? Julias default should be OK.

1 Like

There is

and some other scripts floating around, but it is really, really easy to just download the tarball, extract it, and use it directly.

It should work without setting anything. You may have some stray settings around from earlier experimentation (in your shell config file, etc), make sure you remove those and log in again.

1 Like

Hi Gunnar, Thank you for that. I do appreciate everyone trying to help me here, but I fear I am fighting a losing battle.

I tried your suggestion and it did not work: I got the following error

HTTP request sent, awaiting response… 200 OK
Length: 91990555 (88M) [application/x-tar]
julia-1.2.0-linux-x86_64.tar.gz: Permission denied

Cannot write to \u2018julia-1.2.0-linux-x86_64.tar.gz\u2019 (Success).

It says ‘success’ but there is no /opt/julia

Also the syntax ‘ENV PATH’ doesn’t seem to work in ubuntu

Installing into /opt is something an admin can do, but there’s nothing special about that directory. Try the following as a normal user:

cd $HOME
wget https://julialang-s3.julialang.org/bin/linux/x64/1.2/julia-1.2.0-linux-x86_64.tar.gz
mkdir julia1.2
tar xvfz julia-1.2.0-linux-x86_64.tar.gz --strip-components 1 -C julia1.2
export PATH=$HOME/julia1.2/bin:$PATH
julia

Change the paths if you want to install it somewhere else than $HOME/julia1.2.

That is Docker syntax for modifying environment variables. I replaced it with the export command above.

1 Like

Installation worked for my own linux server (thanks), but my main problem remains.

I am trying to use julia on a web server (i.e. as user www-data) administered by someone else, and I will try and get them to install it this way.

I am wondering, though, if all my issues with paths, etc. have to do with permissions and ownership as a web-user (i.e. use ‘www-data’) Has anyone ever run Julia as ‘www-data’?


******* UPDATE

After explicitly setting the JULIA_LOAD_PATH I (finally!!!) managed to get past the path error, but another error appeared:

ERROR: LoadError: LoadError: syntax: extra token “REPL” after end of expression
while loading /opt/julias/julia-1.2.0/share/julia/stdlib/v1.2/Pkg/src/Pkg.jl, in expression starting on line 398
while loading [my path] /julia_bet_test.jl, in expression starting on line 3

It’s pretty much impossible to debug this without having code to debug. If you could post some kind of example of what you’re trying to do, it would be possible to help. It seems like you’re trying to run Julia in some very unusual manner, but more than that I can’t say.

1 Like

Hi Stefan,

Thanks again for your help.

All I am trying to do is execute

using Pkg

It took me a long while to get the path working, but that is working now - it is finding
Pkg.jl, but running it seems to throw up an error:

ERROR: LoadError: LoadError: syntax: extra token “REPL” after end of expression
while loading /opt/julias/julia-1.2.0/share/julia/stdlib/v1.2/Pkg/src/Pkg.jl, in expression starting on line 398

We are not talking about complicated code here, I just want to get this working so I can start my real work.

Thanks for any ideas. I really do appreciate everyone’s attempts to help me.

It is very likely that the install is somehow a mess. As I suggested a while ago, your best option may be installing a fresh extract of Julia a directory you have write access to (presumably somewhere inside ~), at which point your troubles should be over.

One thing that can go wrong with unusual setups is that the user doesn’t have a HOME environment variable or that it’s pointing to a directory that doesn’t exist or is missing write permission. Try to run these from the Julia REPL:

ENV["HOME"]
write(joinpath(ENV["HOME"], "test"), "test")

Thanks, Tamas,

The people with access to the machine are running julia fine with this installation as users, so it is clear the installation is fine.

I am trying to run julia as a www-data user, and am having no end of issues…

Thanks again, D

Hi Gunnar,

Thank you

Indeed, I think something like that is the issue.

I will try what you suggestion. What should I look for?

Cheers,

D
***** UPDATE ****
I tried your suggestion, and got the following result (note I had explicitly set my home directory as /home/www/admin/ which seems fine):

ERROR: LoadError: MethodError: write has no method matching write(::ASCIIString, ::ASCIIString)
Closest candidates are:
write(!Matched::IO, ::ASCIIString)
write(!Matched::IO, ::AbstractString)
write{T<:Base.AbstractPipe}(!Matched::T<:Base.AbstractPipe, ::Any…)