I’m testing a package that used to work in Julia v. 0.6.2, and which does not work in Julia v.0.6.3, and I’m trying to understand why…
- I install the package (
OMJulia.jl) in a particular directory on my PC (
- I start up Julia, and add the location of this directory to the Julia path (
using OMJulia, I get a normal response (i.e., no error message). (Note: I have not done
- I then do
notebook(), and navigate to a Jupyter/Julia notebook that used to work under Julia v. 0.6.2.
OK – now (v. 0.6.3) the notebook doesn’t work! Issuing command
using OMJulia from the notebook leads to:
ArgumentError: Module OMJulia not found in current path.
Run `Pkg.add("OMJulia")` to install the OMJulia package.
 _require(::Symbol) at .\loading.jl:435
 require(::Symbol) at .\loading.jl:405
What is different in Julia v. 0.6.3? Why doesn’t Julia find package
OMJulia any more?
Something is different in the Julia process you’re running from the command line and the Julia being run in IJulia. To figure out what it is, you can compare the results of:
running in the command line (where your package works) and in an IJulia notebook. Do you see any differences?
rdeits – I found the problem. There is a change from Julia v.0.6.2 to Julia v.0.6.3, I think. In Julia v.0.6.3:
In Julia v. 0.6.2, this changed path was stored in variable
LOAD_PATH – I’m pretty sure of that.
HOWEVER, in Julia v. 0.6.3: when I start
julia> using IJulia
and then navigate to some
IJulia notebook, in the notebook:
In  LOAD_PATH
… and Julia has forgotten the additional path that I pushed into the
LOAD_PATH is just a variable in your current Julia session. Each Julia kernel running in IJulia is a completely separate Julia session, so appending something to LOAD_PATH once will have no effect on its value inside the IJulia kernels. That hasn’t changed since v0.6.2 (or ever, for that matter).
You can show this by starting two copies of Julia from the command line. Modifying LOAD_PATH in one will not affect its value in the other. The same thing is happening in IJulia.
I’m guessing that your workflow must have been somehow different when things were working with v0.6.2. For example, did you have a
~/.juliarc.jl file that was modifying your
Ah. Possibly… I don’t recall it, but you must be right…
- Is there a default
juliarc.jl file, or is this missing unless I create one?
- Where should the
juliarc.jl file be stored? At the location of path
There’s no default file, but if you have one it will be in your home directory (and with an initial dot, like
.juliarc.jl). Where that is exactly is possibly somewhat unclear on Windows: Redirecting to Google Groups but it looks like running
homedir() in Julia should show you where Julia expects to find it.
Alternatively, did you perhaps have the JULIA_LOAD_PATH environment variable set in Windows?
I found it… Typing
%appdata% in Windows Explorer path field, leads to
C:\Users\User_name\AppData\Roaming, and then I navigate to
C:\Users\User_name\AppData\Local\Julia-0.6.3\etc – that’s where the default
juliarc.jl file is located.
Note that the right place to put your configuration file in future versions (v0.7 and higher) will be
~ is whatever
homedir() in Julia returns.
For version 0.6 and below, it’s better to put your configuration in
~/.juliarc.jl instead of editing the one in
AppData, precisely so that it won’t get overwritten by every new Julia update.
Thanks, again: very clarifying and useful to know.