Search code examples
juliaportable-applicationspluto.jl

How to install portable packages with Julia?


I have Julia 1.9.2 installed (current stable release) in a portable fashion. (The .zip file julialang.org offers). It's extracted to an external flash drive (E:\Julia-1.9.2\...) due to university computer restrictions. How do I install a package within the portable Julia install? I would like to leave no trace of Julia on the host computer and keep everything within the external flash drive.

That is, instead of

julia> import Pkg; Pkg.add("Pluto")
    Updating registry at `C:\Users\...`

I would like to see

julia> import Pkg; Pkg.add("Pluto")
    Updating registry at `E:\Julia-1.9.2\...`

Solution

    1. Set the variable

      set JULIA_DEPOT_PATH=E:\Julia-1.9.2\...
      
    2. Run Julia

    3. Version info should show something like:

      julia> versioninfo()
      Julia Version 1.9.2
      ...
      Environment:
        JULIA_DEPOT_PATH = E:\Julia-1.9.2\...
      
    4. Install packages - now they will end up at the E:\Julia-1.9.2\...