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:
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.
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?
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.
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
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
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.
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.
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.
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:
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…)
…