I was working with Julia 1.0 in the past and now want to move my code to Julia 1.3.1. So I have downloaded the Julia 1.3.1 binaries and set a symlink to the new julia executable. When I try “using IJulia” from Julia 1.3 it complains that it is not installed, although I installed it with "Pkg.add(“IJulia”) in Julia 1.0.
Given that it does not seem to recognize the packages in ~/.julia, I would like to take the chance to set a new directory for installing packages from Julia 1.3.1, just to keep things compartmentalized. Does this make practical sense? Or would this lead to useless duplication?
I think I could easily decide on a new directory for the new Julia 1.3.1 by setting JULIA_DEPOT_PATH to my newly desired directory. However, wouldn’t this mess up the package loading from my Julia 1.0 installation?
Alternatively, could I set Base.DEPOT_PATH[1] = “/new/path” in Julia1.3.1/etc/julia/startup.jl to only affect the new version?
You should copy and paste the file .\julia\environments\v1.0\Project.toml to .\julia\environments\v1.3\Project.toml. I always do a ] up as well after this step. This will only download packages that you need, preventing duplication.
And just to add on, there’s no need for you to worry about creating a new directory to hold packages for different Julia versions. Each (minor) version of Julia, like 1.0, 1.1, 1.2, 1.3 has a separate package environment which can be found in ~/.julia/environments. Any packages you install in 1.3 will only affect that environment, so they won’t change any behavior for 1.0.
Thanks for the fast answers and the insights. I had the wrong approach about it, I will read the Pkg documentation to have a better grasp the Julia package system.